|
Pie Chart Labels. |
Posted by jaideep on Aug-02-2012 00:03 |
|
In XY charts, after setting values etc, we can call c.layout() and then use c.yAxis.getticks() to get the ticks on the axis. This can be used to customize the individual labels and values on the xy chart axis.
How do i do that for pie charts? is there a similar method for pie charts too?
thanks,
Jaideep. |
Re: Pie Chart Labels. |
Posted by Peter Kwan on Aug-02-2012 00:44 |
|
Hi jaideep,
For XY charts, the axis scale and tick positions are often determined by ChartDirector by auto-scaling the axis based on the actual data. So it is difficult to predict the tick positions and their values. The Axis.getTicks API allow you to obtain the tick positions after auto-scaling, so you may implement some complex rules in formatting the ticks.
For pie charts, the labels are always know in advance. They are just one label per sector, and your code already knows the data values of all sectors and can set the sector label to anything you like (eg. using Sector.setLabelFormat). So it should not be necessary for ChartDirector to inform you what are the values, as your code already have all the data values, and can always format the labels to anything you like.
As a result, there is not a similar API for pie charts.
Regards
Peter Kwan |
Re: Pie Chart Labels. |
Posted by jaideep on Aug-02-2012 05:32 |
|
Thanks for the explanation. |
|