setting chart series values at runtime
Posted: Fri Nov 03, 2017 2:28 pm
Hello,
I am attempting to set the list of values and arguments for a line series on a chart in the BeforePrint event of the chart.
I've tried using the following code from another post as a guide, but can't quite figure out the correct syntax.
var chart = report.GetComponentByName("Chart1");
(((Stimulsoft.Report.Chart.StiAxis)(((Stimulsoft.Report.Chart.StiAxisArea)((chart as StiChart).Area)).XAxis)).Title).Text = "YourXAxisTitle";
(((Stimulsoft.Report.Chart.StiAxis)(((Stimulsoft.Report.Chart.StiAxisArea)((chart as StiChart).Area)).YAxis)).Title).Text = "YourYAxisTitle";
(((Stimulsoft.Report.Chart.StiAxis)(((Stimulsoft.Report.Chart.StiAxisArea)((chart as StiChart).Area)).YRightAxis)).Title).Text = "YourRightYAxisTitle";
I've tried code similar to the following, but I guess I don't quite understand the code I'm supposed to use.
var chart = report.GetComponentByName("Chart1");
chart.Series[0].ListOfValues = "12;14;16";
I get a message that says... 'Stimulsoft.Report.Components.StiComponent' does not contain a definition for 'Series'...
Can you point me in the right direction?
Is there a programmer's document/website that explains how to code like this?
Thanks,
Carl
I am attempting to set the list of values and arguments for a line series on a chart in the BeforePrint event of the chart.
I've tried using the following code from another post as a guide, but can't quite figure out the correct syntax.
var chart = report.GetComponentByName("Chart1");
(((Stimulsoft.Report.Chart.StiAxis)(((Stimulsoft.Report.Chart.StiAxisArea)((chart as StiChart).Area)).XAxis)).Title).Text = "YourXAxisTitle";
(((Stimulsoft.Report.Chart.StiAxis)(((Stimulsoft.Report.Chart.StiAxisArea)((chart as StiChart).Area)).YAxis)).Title).Text = "YourYAxisTitle";
(((Stimulsoft.Report.Chart.StiAxis)(((Stimulsoft.Report.Chart.StiAxisArea)((chart as StiChart).Area)).YRightAxis)).Title).Text = "YourRightYAxisTitle";
I've tried code similar to the following, but I guess I don't quite understand the code I'm supposed to use.
var chart = report.GetComponentByName("Chart1");
chart.Series[0].ListOfValues = "12;14;16";
I get a message that says... 'Stimulsoft.Report.Components.StiComponent' does not contain a definition for 'Series'...
Can you point me in the right direction?
Is there a programmer's document/website that explains how to code like this?
Thanks,
Carl