|
Using Datasets to create Legends |
Posted by Jeff Shafe on Oct-16-2011 10:35 |
|
Hi Peter,
I've read several posts that talk about using datasets to create legends (instead of "addKey") so that "extra fields" are available for legend entries, but I'm not clear how you attach the dataset to the legend object. Can you clarify this process for me?
Thanks,
Jeff |
Re: Using Datasets to create Legends |
Posted by Peter Kwan on Oct-17-2011 22:28 |
|
Hi Jeff,
If you have a legend box in an XYChart or PolarChart your chart (added by using addLegend), then add data set with a name will automatically be entered into the legend box (unless you explictly disabled it with Layer.setLegendOrder). The icon in the legend box will be the icon used for representing the data set.
For example, in PHP:
$c->addScatterLayer(array(), array(), "ABC XYZ", CircleShape, 9, 0xff0000);
With the above code, if there is a legend box in your chart, an entry with a red circle icon of 9 pixels diameter will be added to the legend box with the text "ABC XYZ".
Hope this can help.
Regards
Peter Kwan |
|