I have a customer that is requesting a pie chart without a legend but with data labels that display callout lines that point to their respective pie sections.
Questions:
1. Is this possible to setup callout lines using the ScalarDataLabel? If not, is it programmatically possible for me to calculate the x,y coordinates to draw the lines myself after adding the chart to the page?
2. I am running into data label overlaps for the pie chart (displaying the description and the percent)... Any advice for me to be able to position the data labels spaced out so that they do not overlap?
Thanks much!
Pie chart with callout lines
Re: Pie chart with callout lines
Support · Jun 6, 2013Hello,
1. Yes, you can hide the legends in the chart and also you can add the data labels with connectors. You will need to set the ScalarDataLabelPosition as OutsideWithConnectors. Below is the sample code for it.
// Create a scalar datalabel
ScalarDataLabel da = new ScalarDataLabel(true, true, true);
// Create a pie series
PieSeries pieSeries = new PieSeries();
pieSeries.DataLabelPosition = ScalarDataLabelPosition.OutsideWithConnectors;
// Set scalar datalabel to the pie series
pieSeries.DataLabel = da;
// Add series to the plot area
plotArea.Series.Add(pieSeries);
//hiding the Legends.
pieSeries.Legend.Visible = false;
2. If you add the data labels outside the pie with connectors it will avoid overlapping of data labels.
Thanks,
ceTe Software Support Team.
Re: Pie chart with callout lines
Forum member · Jun 7, 2013Thanks, that got me a great deal closer. My next question...
Utilizing the callouts worked, but the pie chart graphic size got greatly reduced to make space for the labels and there is a fair amount of white space. Is there any mechanism for me to force the use of more of the area to make the pie chart bigger? If not, is there any way that I can inspect the x,y coordinates of the data labels or individual wedges of the series after I add the chart to the page?
Thanks for your help!
Re: Pie chart with callout lines
Support · Jun 10, 2013Hello,
It is not possible to increase the size of the pie chart as it is calculated dynamically depending on the number of the data label and position. You may have to set the desired width and height to the chart to add bigger pie chart. Also it is not possible to get the X and Y positions of the data labels using our DynamicPDF API.
Thanks,
ceTe Software Support Team.