I have received a lot of great answer and help. Thank you!
However, here's another one!
I'd like to change the order in which the items in the legend appears. I have to add the items to the chart in a certain order otherwise they overlap and hides each other. But this makes the items appear on the legend in the same order that I add them, and not in the order I'd like.
Suggestions?
Thank you...
Sort order in legend
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi ..
How about using a dummy series and an extralegend tool, e.g.I'd like to change the order in which the items in the legend appears. I have to add the items to the chart in a certain order otherwise they overlap and hides each other. But this makes the items appear on the legend in the same order that I add them, and not in the order I'd like.
Code: Select all
Random rnd = new Random();
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line();
line1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None;
line1.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None;
line2.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
line2.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
for(int i=0;i<10;++i) {
line1.Add(rnd.Next(10), rnd.Next(100));
line2.Add(line1[i].X, line1[i].Y);
}
tChart1.Series.Add(line2);
line2.Active = false;
line2.Color = line1.Color;
extraLegend1.Series = line2;
extraLegend1.Legend.Left = 50;
extraLegend1.Legend.Top = 50;
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/