Articles in this section
Category / Section

How to explode a segment in ASP.NET MVC Pie Chart?

3 mins read

Pie Charts are circular charts that render Y values as slices in a pie. These slices are rendered in proportion to the sum of all the Y values in the series. You can explode these slices in any of the following ways.

Explode

Pie series supports Explode property that allows segments to lean out when moving the mouse over the segments. Explode option is not applicable to the pyramid and funnel type series.

CSHTML

      @(Html.EJ().Chart("container")
               .Series(series =>
               {
                     series.Type(SeriesType.Pie).Explode(true).Add();
                     . . . . . . .
               })
               . . . . . . . . 
      )

 

In following screenshot, when the mouse hovers over the first segment, that segment explodes. When mouse moves out, the exploded segment returns to its original position.

Figure 1: First segment explodes

Explodeindex

You can also programmatically explode a segment by using the explodeIndex property for accumulation type series (pie, doughnut, pyramid, and funnel series). To explode all the segments in the series, the explodeAll property is enabled.

CSHTML

      @(Html.EJ().Chart("container")
               .Series(series =>
               {
                     series.Type(SeriesType.Pie).ExplodeIndex(5).Add();
                     . . . . . . .
               })
               . . . . . . . . 
      )

 

The following screenshot displays the chart with programmatically exploded 5th segment by using the above code.

Figure 2: Exploded 5th segment

ExplodeOffset

The explodeOffset property is used to specify the distance between the actual center and the starting position of the exploded point.

CSHTML

      @(Html.EJ().Chart("container")
               .Series(series =>
               {
                     series.Type(SeriesType.Pie).ExplodeIndex(5).ExplodeOffset(35).Add();
                     . . . . . . .
               })
               . . . . . . . . 
      )

 

The following screenshot displays the Pie Chart with the 5th index exploded to 35 pixels from the center.

Figure 3: 5th index exploded to 35 pixels from the center


Conclusion

I hope you enjoyed learning about how to explode a segment in the Pie Chart

You can refer to our ASP.NET MVC Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET MVC Chart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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