Hello i want to draw in my Graph four lines different color.when i write code, which is belove ,four lines look different color then i wrote as shown in picture.Especially white color looks very bad.Please could you help ,how i can draw different color lines?
Line newLine = new Line();
newLine.LinePen.Width = 5;
series = newLine;
series[0].Color = Color.Red;
series[1].Color = Color.Purple;
series[2].Color = Color.Black;
series[3].Color = Color.Yellow;
Line Color Problem
-
- Newbie
- Posts: 25
- Joined: Thu Dec 27, 2007 12:00 am
Line Color Problem
- Attachments
-
- Color.JPG (82.41 KiB) Viewed 5731 times
Re: Line Color Problem
Hi Solutions Gallery BV,
I think you are a little bit mistaken.
I see in your code that "series" is a Line series. Accessing to it's list you are accessing to the points of your series.
I understand you are trying to access to your chart series list, not your series point list, so you should do:
Or also, the same:
I think you are a little bit mistaken.
I see in your code that "series" is a Line series. Accessing to it's list you are accessing to the points of your series.
I understand you are trying to access to your chart series list, not your series point list, so you should do:
Code: Select all
tChart1.Series[0].Color = Color.Red;
tChart1.Series[1].Color = Color.Purple;
tChart1.Series[2].Color = Color.Black;
tChart1.Series[3].Color = Color.Yellow;
Code: Select all
tChart1[0].Color = Color.Red;
tChart1[1].Color = Color.Purple;
tChart1[2].Color = Color.Black;
tChart1[3].Color = Color.Yellow;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 25
- Joined: Thu Dec 27, 2007 12:00 am
Re: Line Color Problem
Hello Yeray
I tried the code which you wrote.But it gives error.Error is "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection"
Thanks
I tried the code which you wrote.But it gives error.Error is "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection"
Thanks
Re: Line Color Problem
Hello Solutions Gallery BV,
Could you say us, if previous code works as you want and is a good solution for your problem?
I hope will helps.
Thanks,
I think that you need add your lines, previously change color for each lines. Please, try check again,our code using next lines:I tried the code which you wrote.But it gives error.Error is "System.ArgumentOutOfRangeException: Index was out of range.
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
for (int i = 0; i < 4; i++)
{
new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1[i].FillSampleValues();
(tChart1[i] as Steema.TeeChart.Styles.Line).LinePen.Width = 5;
}
tChart1.Series[0].Color = Color.Red;
tChart1.Series[1].Color = Color.Purple;
tChart1.Series[2].Color = Color.Black;
tChart1.Series[3].Color = Color.Yellow;
}
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 |