ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Automatic legend in pie
Posted by Michael Opitz on Aug-11-2011 23:36
Hi Peter,

is it somehow possible to switch off the automatic legend creation in the pie chart like it is possible in the XYChart with layer.setLegendOrder(Chart.NoLegend); ?

I would like to create my own legend entries in a legend box inside a pie chart.

I am still using CD 4.1

Regards,
Michael

  Re: Automatic legend in pie
Posted by Peter Kwan on Aug-12-2011 00:48
Hi Michael,

In PieChart.setData, if you do not specify the labels, then there will be no legend entry. For example:

$c->setData($myData);

If you need to use the labels somewhere else (such as in sector labels), you would need to use an extra field to represent the labels. It is like:

$c->addExtraField($labels);
$c->setLabelFormat("{field0}:{percent}%");

Hope this can help.

Regards
Peter Kwan