We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Hide some Datalabels of pie chart

Is it possible to hide some data labels of pie chart. Lets say i want to keep pies with less than 2% in chart but i do not want to show data labels of such pies. Ex in below image , i want to remobe “Book 1%” datalabel. Is there
a way to do this.

image.png (9.1 KB)

I have tried by
finding the data point in NSeries with lowest pie share and assigning empty string to data label text property , but its not working as expected,

            var lowestSharePoint = chart.NSeries[seriesIndex].Points[lowestSharePointIndex ];
            lowestSharePoint .DataLabels.ShowValue = true;
            lowestSharePoint .DataLabels.Text = "";

Kindly suggest some help. Thanks


Thanks for the screenshot.

Well, you may delete the specific data labels for the data point of the series. You need to first find out the chart point (in the series) by yourself whose data label should not be shown on the chart. See the sample line of code segment:
Sample code:

chart.NSeries[0].Points[i].DataLabels.IsDeleted = true; 


Hope, this helps a bit.

Thanks Amjad, This solved my purpose.


Good to know that the suggested line of code figures out your issue now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.