|
Legend with custom keys only |
Posted by Stephan on Jan-22-2016 22:19 |
|
Hello all,
I am working with CD 5.1 C++.
Is there a way to add a LegendBox to a chart that does only show the keys that I add with my code ?
So for example, I do add line layers with names, and data sets with names, but all I
want to see in my legend is just Mice and Cats, the keys that I add manually like
this:
LegendBox *lb = chart->addLegend(55, 32, false, "arialbd.ttf", 9);
lb->addKey("Mice", 0x00ff00);
lb->addKey("Cats", 0x0000ff);
Or do I have to draw the legend from scratch by my self with TextBox, and not
use LegendBox at all ?
Thanks for any help,
Stephan |
Re: Legend with custom keys only |
Posted by Peter Kwan on Jan-22-2016 23:21 |
|
Hi Stephan,
If you add line layers with names, but do not want those names to automatically appear in
the legend box, you may use Layer.setLegendOrder, like:
layer->setLegendOrder(Chart::NoLegend);
Hope this can help.
Regards
Peter Kwan |
Re: Legend with custom keys only |
Posted by Stephan on Jan-27-2016 14:15 |
|
Hello Peter,
thank you, that is exactly what I was looking for. |
|