Exception when Rendering a chart with many datapoints
Posted: Fri Oct 24, 2014 12:02 pm
Hello dear Stimulsoft support team,
in our software we use/generate a few (line) charts which use a couple hundred data points.
In the version of stimulsoft we currently use and also ship we have encountered an exception while rendering such charts.
It doesnt happen every time – it seems like it only happens when the chart does have more than 800 datapoints and the line has got gaps.
The exception which is raised is:
System.InvalidOperationException: Nullable object must have a value.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at Stimulsoft.Report.Chart.StiBaseLineSeriesCoreXF.OptimizePoints(Nullable`1[] points)
at Stimulsoft.Report.Chart.StiBaseLineSeriesCoreXF.RenderSeries(StiContext context, RectangleF rect, StiAreaGeom geom, IStiSeries[] series)
at Stimulsoft.Report.Chart.StiAxisAreaCoreXF.RenderSeries(StiContext context, RectangleF rect, StiAreaGeom geom, List`1 seriesCollection)
at Stimulsoft.Report.Chart.StiAxisAreaCoreXF.Render(StiContext context, RectangleF rect)
at Stimulsoft.Report.Chart.StiChartCoreXF.Render(StiContext context, RectangleF rect, Boolean useMargins)
at Stimulsoft.Report.Painters.StiChartGdiPainter.DrawChart(StiChart chart, Graphics g, RectangleF rect, Boolean useMargins, Boolean useBackground)
at Stimulsoft.Report.Painters.StiChartGdiPainter.PaintChart(StiChart chart, Graphics g, RectangleF rect, Boolean drawBorder, Boolean drawFormatting)
at Stimulsoft.Report.Painters.StiChartGdiPainter.GetImage(StiComponent component, Single& zoom, StiExportFormat format)
at Stimulsoft.Report.Chart.StiChart.GetImage(Single& zoom, StiExportFormat format)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)
Current Version used: 2014.2.1924
Version used before that: 2013.2.1700 (without the described exception)
Latest version tried: 2014.2.2000 (Stimulsoft-Reports-Net-2014.2-Trial)
The exception can also be raised with the designer when previewing a chart (tried with versions 2014.x and later)
Attached (in ManyDatapointsChart.zip) you can find a sample MRT file including xsd and xml data. (to raise the described exception any given <column1> line of charttable_0 can be removed or commented out from the xml data).
We use a temporary work around which avoids the call of optimizePoints but on the long run can you please look into the error/exception and fix it.
Thank you in advance,
Doreen C
in our software we use/generate a few (line) charts which use a couple hundred data points.
In the version of stimulsoft we currently use and also ship we have encountered an exception while rendering such charts.
It doesnt happen every time – it seems like it only happens when the chart does have more than 800 datapoints and the line has got gaps.
The exception which is raised is:
System.InvalidOperationException: Nullable object must have a value.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at Stimulsoft.Report.Chart.StiBaseLineSeriesCoreXF.OptimizePoints(Nullable`1[] points)
at Stimulsoft.Report.Chart.StiBaseLineSeriesCoreXF.RenderSeries(StiContext context, RectangleF rect, StiAreaGeom geom, IStiSeries[] series)
at Stimulsoft.Report.Chart.StiAxisAreaCoreXF.RenderSeries(StiContext context, RectangleF rect, StiAreaGeom geom, List`1 seriesCollection)
at Stimulsoft.Report.Chart.StiAxisAreaCoreXF.Render(StiContext context, RectangleF rect)
at Stimulsoft.Report.Chart.StiChartCoreXF.Render(StiContext context, RectangleF rect, Boolean useMargins)
at Stimulsoft.Report.Painters.StiChartGdiPainter.DrawChart(StiChart chart, Graphics g, RectangleF rect, Boolean useMargins, Boolean useBackground)
at Stimulsoft.Report.Painters.StiChartGdiPainter.PaintChart(StiChart chart, Graphics g, RectangleF rect, Boolean drawBorder, Boolean drawFormatting)
at Stimulsoft.Report.Painters.StiChartGdiPainter.GetImage(StiComponent component, Single& zoom, StiExportFormat format)
at Stimulsoft.Report.Chart.StiChart.GetImage(Single& zoom, StiExportFormat format)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)
Current Version used: 2014.2.1924
Version used before that: 2013.2.1700 (without the described exception)
Latest version tried: 2014.2.2000 (Stimulsoft-Reports-Net-2014.2-Trial)
The exception can also be raised with the designer when previewing a chart (tried with versions 2014.x and later)
Attached (in ManyDatapointsChart.zip) you can find a sample MRT file including xsd and xml data. (to raise the described exception any given <column1> line of charttable_0 can be removed or commented out from the xml data).
We use a temporary work around which avoids the call of optimizePoints but on the long run can you please look into the error/exception and fix it.
Thank you in advance,
Doreen C