Hi I have a line graph with about 100 points.
It is a red line
Now I want the line connecting point number 45, 46 and 47 to be green.
Is that possible? How?
Thanks in advance
Lars Iversen
change color on a part of a line graph
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lars,
Yes, you have 2 options:
1) Setting the color when populating the series:
2) Setting the color for the points you want doing something like:
Yes, you have 2 options:
1) Setting the color when populating the series:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
Random rd = new Random();
for (int i = 0; i < 100; i++)
{
if ((i>45) && (i<=47))
line1.Add(rd.Next(),Color.Green);
else
line1.Add(rd.Next(),Color.Red);
}
}
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
line1.Colors[46] = Color.Green;
line1.Colors[47] = Color.Green;
line1.Repaint();
}
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 |