|
Inquiry About Legend Sorting in Pie Chart |
Posted by Ji-hyeon Choi on Mar-11-2025 12:44 |
|
Hello,
I would like the pie chart's legend to be sorted as shown in the attached image on the right. Is there a way to achieve this?
We look forward to your response.
Best regards.
|
Re: Inquiry About Legend Sorting in Pie Chart |
Posted by Peter Kwan on Mar-11-2025 15:57 |
|
Hi Ji-hyeon,
The legend in the right pie chart starts from the red sector, and then flows anti-clockwise.
You can use PieChart.setStartAngle to configure ChartDirector to flow the sectors in the same way. See:
https://www.advsofteng.com/doc/cdjava.htm#anglepie.htm
For your case, please add the line:
// First sector (red) start at 90 degrees, and other sectors flow anti-clockwise
c.setStartAngle(90, false);
// Add border to the sectors. The border color is semi-transparent white (0x7fffffff)
c.setLineColor(0x7fffffff);
Best Regards
Peter Kwan |
Re: Inquiry About Legend Sorting in Pie Chart |
Posted by Ji-hyeon Choi on Mar-11-2025 16:03 |
|
I'm sorry for the misunderstanding. What I meant was about the text in the legend.
Is it possible to align the values and text in the legend as shown on the right side of the image? |
|