Page 1 of 1
Add a constant line to the report
Posted: Fri Oct 12, 2012 3:54 am
by mihiri1
On Chart component, there is a option to add a constant line, But that constant value has to be hard coded at design time. Is it possible that this can be set at run time?
I use SS 2011.1.919
Re: Add a constant line to the report
Posted: Fri Oct 12, 2012 8:07 am
by Alex K.
Hello,
Please try to use the following code:
Code: Select all
StiChart chart1 = report.GetComponents()["Chart1"] as StiChart;
Stimulsoft.Report.Chart.StiConstantLines line1 = new Stimulsoft.Report.Chart.StiConstantLines();
line1.LineColor = System.Drawing.Color.Black;
line1.Text = "Constant Line 1";
line1.AxisValue = "2";
chart1.ConstantLines.Clear();
chart1.ConstantLines.AddRange(new Stimulsoft.Report.Chart.IStiConstantLines[] {
line1 });
Thank you.
Re: Add a constant line to the report
Posted: Wed Oct 17, 2012 11:28 pm
by mihiri1
Hi Thanks, It works.
Is there any way that I can set the Constant lien Text to appear on the Right, instead of the Left?
Or is there a way I can make a separate legend for the constant lines.
Re: Add a constant line to the report
Posted: Thu Oct 18, 2012 6:03 am
by Alex K.
Hello,
Please try to use the following code:
Code: Select all
line1.Position = Stimulsoft.Report.Chart.StiConstantLines.StiTextPosition.RightTop;
Thank you.
Re: Add a constant line to the report
Posted: Fri Oct 19, 2012 1:21 am
by mihiri1
hi
Tried settting line1.Position = Stimulsoft.Report.Chart.StiConstantLines.StiTextPosition.RightTop;
But it makes the label to go completely disappeared.
However I tried LeftTop/ LeftBottom which worked all right.
Any idea about why RightTop/RightBottom do no work?
Thanks
Re: Add a constant line to the report
Posted: Fri Oct 19, 2012 7:58 am
by Alex K.
Hello,
The issue is fixed.
Please check the next prerelease build which will be available today.
Thank you.