Getting data into a chart
Getting data into a chart
Hello,
I'm trying to get a chart to show some manually compiled data. On the ChartBeforePrint-event, I use the following code:
Stimulsoft.Report.Chart.StiLineSeries seriesLine = new Stimulsoft.Report.Chart.StiLineSeries();
seriesLine.Title = "Anzahl Personen";
object[] arg = new object[3];
seriesLine.Arguments = arg;
seriesLine.Arguments[0] = "A";
seriesLine.Arguments[1] = "B";
seriesLine.Arguments[2] = "C";
double[] val = new double[3];
seriesLine.Values = val;
seriesLine.Values[0] = 1;
seriesLine.Values[1] = 5;
seriesLine.Values[2] = 7;
Chart1.Series.Add(seriesLine);
The resulting chart shows only the title of the series, but not the graph.
Could you please tell me if I am forgetting something?
I'm trying to get a chart to show some manually compiled data. On the ChartBeforePrint-event, I use the following code:
Stimulsoft.Report.Chart.StiLineSeries seriesLine = new Stimulsoft.Report.Chart.StiLineSeries();
seriesLine.Title = "Anzahl Personen";
object[] arg = new object[3];
seriesLine.Arguments = arg;
seriesLine.Arguments[0] = "A";
seriesLine.Arguments[1] = "B";
seriesLine.Arguments[2] = "C";
double[] val = new double[3];
seriesLine.Values = val;
seriesLine.Values[0] = 1;
seriesLine.Values[1] = 5;
seriesLine.Values[2] = 7;
Chart1.Series.Add(seriesLine);
The resulting chart shows only the title of the series, but not the graph.
Could you please tell me if I am forgetting something?
Getting data into a chart
This code will be work fine if you add chart to compiled report. In your case you add this chart to not compiled report. So you need use following code:
Thank you.
Code: Select all
Stimulsoft.Report.Chart.StiLineSeries seriesLine = new Stimulsoft.Report.Chart.StiLineSeries();
seriesLine.Title = "Anzahl Personen";
seriesLine.ListOfArguments.Value = "A;B;C";
seriesLine.ListOfValues.Value = "1;5;7";
Chart1.Series.Add(seriesLine);
Getting data into a chart
I tried this, but sadly, it has the same result. The chart still shows only the title, but nothing else.
Getting data into a chart
Can you show other code you are use before and after provided code?
Getting data into a chart
There is just this code. I'm using it in the Designer, in the BeforePrint-event of the chart. The chart is empty and should only have the series I add in the event code.
Getting data into a chart
Instead BeforePrintEvent please use ProcessChartEvent and following code:
Thank you.
Code: Select all
Stimulsoft.Report.Chart.StiChart chart = sender as Stimulsoft.Report.Chart.StiChart;
Stimulsoft.Report.Chart.StiLineSeries seriesLine = new Stimulsoft.Report.Chart.StiLineSeries();
seriesLine.Title = "Anzahl Personen";
object[] arg = new object[3];
seriesLine.Arguments = arg;
seriesLine.Arguments[0] = "A";
seriesLine.Arguments[1] = "B";
seriesLine.Arguments[2] = "C";
double[] val = new double[3];
seriesLine.Values = val;
seriesLine.Values[0] = 1;
seriesLine.Values[1] = 5;
seriesLine.Values[2] = 7;
chart.Series.Add(seriesLine);
Getting data into a chart
Thanks a lot, it works fine now.
Getting data into a chart
Please contact us if you need any help.