I've created two charts, in first I set data column to 45;34;78 in expresion editor and in value column 6;7;9, and chart is diplayed correctly.
In second I try set values from Dataset. In Data Source in ReportData I added column Years with type int and Percents with type int too.
To data set I pass properties Years as new int[] {3,4,5} and Percents as new int[] {6,7,8}.
Code: Select all
public int[] Percents { get; set; }
public int[] Years { get; set; }
Code: Select all
report.Percents = new int[] { 12, 34, 56 };
report.Years = new int[] { 1, 2, 3, 5 };
DataRow mainDataRow = mainReportDataTable.NewRow();
Code: Select all
if (!mainDataRow .Table.Columns.Contains("Years"))
mainDataRow .Table.Columns.Add("Years");
mainDataRow ["Years"] = report.Years;
And when report is rendere it throw exception:
Invalid Cast Exception: {System.Nullable`1[System.Double][] GetValuesFromValueDataColumn(Stimulsoft.Report.Chart.StiChart, Stimulsoft.Report.Chart.StiSeries)}
I was trying replace int[] to int?[] or double?[] and still this same error occur.
It works when I replace int[] to int and assign Years = 7 but in chart I have only one value