Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Tue Apr 14, 2020 9:12 am

Hi, I have a pie chart where the DataLabels values are overlapping.
i have used the bellow code but those are not readable.
chart.Series[0].DataLabels.LabelValueVisible = true;
chart.Series[0].DataLabels.LeaderLinesVisible = true;
chart.Series[0].DataLabels.LeaderLines.LineEndLength=Spire.Presentation.LineEndLength.Long;
chart.Series[0].DataLabels.LeaderLines.LineBeginLength = Spire.Presentation.LineEndLength.Long;

Please help me to get clear,readable Pie chart.

AnuH365068
 
Posts: 13
Joined: Wed Mar 04, 2020 10:45 am

Tue Apr 14, 2020 10:34 am

Hello,

Thanks for your inquiry.
Please refer to the below code snippet to set position of chart data labels. If there is any question, please provide your expected output for further investigation.
Code: Select all
    ChartDataLabel label1 = chart.Series[0].DataLabels.Add();
    label1.ID = 0;
    label1.X = 10f;
    label1.Y = 20f;
    //Set label value visible
    label1.LabelValueVisible = true;
    //Set legend key invisible
    label1.LegendKeyVisible = false;
    //Set category name invisible
    label1.CategoryNameVisible = false;
    //Set series name invisible
    label1.SeriesNameVisible = false;
    //Set Percentage invisible
    label1.PercentageVisible = false;


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Presentation

cron