Page 1 of 1
Order of series name/title in legend
Posted: Mon Apr 13, 2009 7:30 pm
by 7667591
Currently, legend displays series names/titles based on the order of being added. Is there any way to force legend to show items based on the nature order of data type no matter what? i.e. c1->c2->c3. We can sort series names before adding them to chart but, when the order is changed manually, like Z-Order, we do not want it reflect on the legend. How do we fix the content in legend despite the changes made on Z-Orders?
Thanks,
Posted: Tue Apr 14, 2009 7:12 am
by narcis
Hi Chen,
You should use LegendResolver as shown in the Miscellaneous -> Legend -> Resolver example in TeeChart.Features.jar demo included with the installation.
Posted: Tue Apr 14, 2009 3:49 pm
by 7667591
Hi Narcís,
Thanks for your reply. I guess there might some misunderstanding here. I know legendResolver can modify each items in legend for display purpose, like a labelProvider in table viewer or so. But, it will not change the order from top to bottom for each item displayed. All I want is to change the order of series names/titles displayed in legend. Currently, it is based only on the order of being added to chart. Is there anyway I can get all series for teeChart and sort them by nature order of data type and display in legend?
Thanks,
Chen
Posted: Wed Apr 15, 2009 7:16 am
by narcis
Hi Chen,
Yes, that's what I understood but that's the only way I could think of achieving that. I've added your request to the wish-list to be considered for inclusion in future releases.
Posted: Wed Apr 15, 2009 2:26 pm
by 7667591
Hi Narcís,
Would you please explain more how can I do in LegendResovler to implement this?
Thanks again,
Chen
Posted: Wed Apr 15, 2009 2:35 pm
by narcis
Hi Chen,
You should just set each legend item text in the order you like in the getItemText method.