I have a bar graoh and specified the colours like so:-
bar1.Add(age1m, "Under 20", Color.Green);
bar1.Marks.Visible = false;
bar2.Add(age1f, "Under 20", Color.Orange);
bar2.Marks.Visible = false;
bar1.Add(age2m, "20-29", Color.Green);
bar1.Marks.Visible = false;
bar2.Add(age2f, "20-29", Color.Orange);
bar2.Marks.Visible = false;
How do I get the legend colour to match, see example you will see different colours
Legend Different Colour
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
Legend Different Colour
- Attachments
-
- RAL_488_AgeGraph.jpg (95.47 KiB) Viewed 6481 times
Re: Legend Different Colour
Hello MikeTheLad,
Is normally that if you defines the color for each point and you have more of one series color of Symbol of Legend doesn't change. So, if you modify color a concretely point of Series it doesn't know which color has use. If you want achieve symbol of legend have same color of bar series that you see in Chart, you need change color of bar using property bar.Color as do in next example:
Can you tell us if previous code works as you expected?
I hope will helps.
Thanks,
Is normally that if you defines the color for each point and you have more of one series color of Symbol of Legend doesn't change. So, if you modify color a concretely point of Series it doesn't know which color has use. If you want achieve symbol of legend have same color of bar series that you see in Chart, you need change color of bar using property bar.Color as do in next example:
Code: Select all
Steema.TeeChart.Styles.Bar bar1, bar2;
private void InitializeChart()
{
bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar1.Color = Color.Green;
bar2.Color = Color.Orange;
bar1.Add(18, "Under 20");
bar2.Add(10, "Under 20");
bar1.Add(23, "20-29");
bar2.Add(28, "20-29");
bar1.Marks.Visible = false;
bar2.Marks.Visible = false;
}
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: 65
- Joined: Mon Jan 19, 2004 5:00 am
Re: Legend Different Colour
That worked thanks