Order of series name/title in legend

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

Order of series name/title in legend

Post by Chen » Mon Apr 13, 2009 7:30 pm

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,

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Apr 14, 2009 7:12 am

Hi Chen,

You should use LegendResolver as shown in the Miscellaneous -> Legend -> Resolver example in TeeChart.Features.jar demo included with the installation.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

Post by Chen » Tue Apr 14, 2009 3:49 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 15, 2009 7:16 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

Post by Chen » Wed Apr 15, 2009 2:26 pm

Hi Narcís,
Would you please explain more how can I do in LegendResovler to implement this?


Thanks again,

Chen

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 15, 2009 2:35 pm

Hi Chen,

You should just set each legend item text in the order you like in the getItemText method.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply