Hello,
I am trying to dynamically add multiple fastline series to a chart. I have done this easily in the past using the active x component via "TChart1.AddSeries scFastLine". However, in the NET component it seems that one must construct a unique fastline class, then use that name to add to the chart.
Example:
//Prepare chart
this.tChart1.Series.Clear(true);
Steema.TeeChart.Styles.FastLine fastline1 = new Steema.TeeChart.Styles.FastLine();
Steema.TeeChart.Styles.FastLine fastline2 = new Steema.TeeChart.Styles.FastLine();
Steema.TeeChart.Styles.FastLine fastline3 = new Steema.TeeChart.Styles.FastLine();
for (int i = 0; i < intSegmentCnt; i++)
{
string strCnt = Convert.ToString(i + 1);
string strLineName = "fastline" + Convert.ToString(i * 3);
this.tChart1.Series.Add(fastline1);
this.tChart1.Series[i * 3].Title = "BIE" + strCnt;
this.tChart1.Series[i * 3].VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
this.tChart1.Series.Add(fastline2);
this.tChart1.Series[(i * 3) + 1].Title = "EVM" + strCnt;
this.tChart1.Series[(i * 3) + 1].VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
this.tChart1.Series.Add(fastline3);
this.tChart1.Series[(i * 3) + 2].Title = "PWR" + strCnt;
this.tChart1.Series[(i * 3) + 2].VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
}
This works on the first pass through the loop, but on the second pass the fastline types are invalid.
Any hints?
Regards,
Mark
Dynamically Adding Fastline Series?
Hello MarkR,
I recomend that delete or coment this lines of your code:
Out of For:
In of For
And change previous lines for next code in for and checked that works fine in your application :
I hope that will helps.
Thanks,
I recomend that delete or coment this lines of your code:
Out of For:
Code: Select all
Steema.TeeChart.Styles.FastLine fastline1 = new Steema.TeeChart.Styles.FastLine();
Steema.TeeChart.Styles.FastLine fastline2 = new Steema.TeeChart.Styles.FastLine();
Steema.TeeChart.Styles.FastLine fastline3 = new Steema.TeeChart.Styles.FastLine();
In of For
Code: Select all
this.tChart1.Series.Add(fastline1);
this.tChart1.Series.Add(fastline2);
this.tChart1.Series.Add(fastline3);
Code: Select all
new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
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 |
Sandra,
Thank you very much! I had figured that I was missing the proper (elegant) syntax for getting this accomplished, I was performing it the brute force method.
Also, thank you for the exceptionally fast reply. THIS IS THE SECOND REASON WHY I LOVE THE STEEMA PRODUCTS! The first is that tChart is an excellent product.
Regards,
Mark
Thank you very much! I had figured that I was missing the proper (elegant) syntax for getting this accomplished, I was performing it the brute force method.
Also, thank you for the exceptionally fast reply. THIS IS THE SECOND REASON WHY I LOVE THE STEEMA PRODUCTS! The first is that tChart is an excellent product.
Regards,
Mark
Hello MarkR,
You are welcome .
Thanks,
You are welcome .
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 |