Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using asp.net chart control for doughnut chart on my web application. its working fine but I want to increase the hole size. I checked google and find the default size is 60. but I dont know how to change this hole size. Please can anyone help me on this


Thanks
Posted

1 solution

hi, you can do changes the radius of doughnut chart in chart.js in the line below :

var
C#
Doughnut = function(data, config, ctx) {
        var segmentTotal = 0;

        //In case we have a canvas that is not a square. Minus 5 pixels as padding round the edge.
        var doughnutRadius = Min([height / 2, width / 2]) - 5;

        var cutoutRadius = doughnutRadius * (config.percentageInnerCutout / 100);

        for (var i = 0; i < data.length; i++) {
            segmentTotal += data[i].value;
        }

.....

regards
 
Share this answer
 
v2
Comments
Ayyappan Ravi 31-Jul-14 9:19am    
Hi
Below is my .aspx chart control code. can you help to increase the hole size of the doughnut chart

<asp:Chart ID="Chart2" runat="server" Height="600px" Width="600px">
<Titles>
<asp:Title ShadowOffset="3" Name="Student Marks" />
</Titles>
<legends>
<asp:Legend Alignment="Center" Docking="Bottom" IsTextAutoFit="true" Name="Legend"
LegendStyle="Table" />

<series>
<asp:Series Name="Legend" BorderColor="White" BorderWidth="1"
ChartType="Doughnut" CustomProperties="PieStartAngle=270" />


<chartareas>
<asp:ChartArea Name="studentChartArea" BorderWidth="0">


deepankarbhatnagar 1-Aug-14 6:45am    
The hole size or radius of daughtnut chart will increase or decrease in the changes of chart.js you must be using. The code which I have mention above is from chart.js only. Please do appropriate changes in chart.js.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900