Chart Constant Lines

Stimulsoft Ultimate discussion
Post Reply
scott
Posts: 21
Joined: Tue Feb 22, 2011 1:57 pm
Location: USA

Chart Constant Lines

Post by scott »

Is there a way to set a Constant Line value for a Chart at runtime?

Thanks!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Chart Constant Lines

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
scott
Posts: 21
Joined: Tue Feb 22, 2011 1:57 pm
Location: USA

Chart Constant Lines

Post by scott »

For a Chart component in the Stimulsoft designer -> Properties -> 3. Chart Additional -> Constant Lines you can add values for lines in the chart to show constant values. Is there a way to add constant lines values at the time of report generation? Or from C# code?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Chart Constant Lines

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

StiReport report = new StiReport();
report.Load();
StiChart chart1 = report.GetComponents()["Chart1"] as StiChart;
StiConstantLines lines1 = new Stimulsoft.Report.Chart.StiConstantLines();
lines1.AxisValue = "0.3";
lines1.LineColor = System.Drawing.Color.Black;
lines1.Text = "Constant Line 1";
lines1.Font = new System.Drawing.Font("Arial", 7F);
lines1.Chart = chart1;
chart1.ConstantLines.Add(lines1);
report.Show();
Thank you.
scott
Posts: 21
Joined: Tue Feb 22, 2011 1:57 pm
Location: USA

Chart Constant Lines

Post by scott »

Awesome! Thanks, Aleksey.
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Chart Constant Lines

Post by Andrew »

We are always glad to help you.

Thank you.
Post Reply