Articles in this section
Category / Section

How to change the size of the doughnut hole in ASP.NET MVC Chart?

2 mins read

You can customize the size of doughnut hole and the size of doughnut by using DoughnutCoefficient property and DoughnutSize property respectively with respect to chart size.

Doughnut size

Doughnut series supports DoughnutSize property that controls the size of the doughnut series with respect to the available chart size. Doughnut series takes the entire chart space when DoughnutSize is 1, it takes value from 0 to 1. By default the value of doughnutSize is 0.8.

CSHTML

@(Html.EJ().Chart("container")
            .Series(series => 
                series.DoughnutSize(0.7f)
                . . . . . .
                . . . . . .
             )
             . . . . . . .
)

 

The following screenshot displays doughnut chart with doughnut size 0.7

Doughnut Coefficient

Doughnut charts are pie charts with a hole at center, whose value is specified using DoughnutCoefficient property. It takes values from 0 to1. By default the value of DoughnutCoefficient property is 0.4

CSHTML

@(Html.EJ().Chart("container")
            .Series(series => 
                series.DoughnutCoefficient(0.6f)
                . . . . . .
                . . . . . .
            )
            . . . . . .
)

 

The following screenshot displays doughnut chart with doughnut coefficient 0.6

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied