Hi Steema Support,
We are working on a project which is being created in Silverlight. For this we are using Tee-Chart for .NET 2010 Silverlight version. We want to know is there any possible way to reorder legend’s item in legend of any chart.
In following image we have describes what we are expecting.
Any suggestion will be highly appreciated.
Thanks & Regards
Plano research
Legend reordering
Re: Legend reordering
Hello Planoresearch,
Ok. I think you can do something as next code:
How you see, previous code allow you to reorder the items text of legend. Moreover, I think should be useful for you, use event OnSymbolDraw what allow modified the symbol of legend.
I hope will helps.
Thanks,
Ok. I think you can do something as next code:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Silverlight.Styles.Pie pie1 = new Steema.TeeChart.Silverlight.Styles.Pie(tChart1.Chart);
pie1.FillSampleValues(2);
}
private void button1_Click(object sender, RoutedEventArgs e)
{
string tmp,tmp1;
tmp = tChart1.Legend.Items[0].Text;
tmp1 = tChart1.Legend.Items[0].Text2;
tChart1.Legend.Items[0].Text = tChart1.Legend.Items[1].Text;
tChart1.Legend.Items[0].Text2 = tChart1.Legend.Items[1].Text2;
tChart1.Legend.Items[1].Text = tmp;
tChart1.Legend.Items[1].Text2 = tmp1;
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 57
- Joined: Thu Jun 02, 2011 12:00 am
Re: Legend reordering
Hi Sandra,
Thanks for the quick reply and code you provided. The code is working fine for swapping only legend text. But here we want to change order of whole legend item (text with its symbol).
You have suggested me to use OnSymbolDraw event for this. We will try to explore this. Meanwhile if you find any sample code or related link to solve this problem then please let us know.
Thanks in advance.
Thanks & Regards
Plano research
Thanks for the quick reply and code you provided. The code is working fine for swapping only legend text. But here we want to change order of whole legend item (text with its symbol).
You have suggested me to use OnSymbolDraw event for this. We will try to explore this. Meanwhile if you find any sample code or related link to solve this problem then please let us know.
Thanks in advance.
Thanks & Regards
Plano research
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Legend reordering
Hello,
An alternative could be creating your own custom legend similar to the example Christopher Ireland posted on this thread.
An alternative could be creating your own custom legend similar to the example Christopher Ireland posted on this thread.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |