We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Exception while redrawing chart

Hi, I have the current situation: I need to have a chart who shows the data of a single month, so I need to have the primary X axis of type 'datetime' to go from the first day to the last day of the month, without "overflowing" to other months, because that'll show no data for days that might have data.

The data is loaded by AJAX and I can change month, so, when redrawing the chart, I change both the data and the range.
Here go the pseudo-code at the end of the AJAX call:

chart.model.series = monthSeries;
chart.model.primaryXAxis.range.interval = 3;
chart.model.primaryXAxis.range.max = firstOfMonth;
chart.model.primaryXAxis.range.min = endOfMonth;
chart.model.primaryXAxis.setRange = true;

Without the "chart.model.primaryXAxis.setRange = true;", all the range settings are ignored.

Redrawing some months gives an error, while others go smoothly.
There is no correlation in the data of the months giving errors, as far as I can tell.

The error and its stack trace is the following:
'Unable to get property 'Region' of undefined or null reference'
Line: var p=this.chartObj.model.chartRegions[y].Region.Bounds
 y is 0
 'this.chartObj.model.chartRegions' is an array of length = 0
ej.EjSeriesRender.prototype.textPosition [Line: 10, Col: 4403406], ej.web.all.min.js
ej.EjSeriesRender.prototype.drawDataLabel [Line: 10, Col: 4378716], ej.web.all.min.js
Anonymous function [Line: 10, Col: 4508815], ej.web.all.min.js
each [Line: 360, Col: 5], jquery-2.2.0.js
ej.ejChart.drawDisplayText [Line: 10, Col: 4507273], ej.web.all.min.js
ej.ejChart.renderSeries [Line: 10, Col: 4506328], ej.web.all.min.js
ej.ejChart.seriesRender [Line: 10, Col: 4498445], ej.web.all.min.js
ej.ejChart.draw [Line: 10, Col: 4487563], ej.web.all.min.js
ej.ejChart.bindTo [Line: 10, Col: 4514243], ej.web.all.min.js
redraw [Line: 10, Col: 4701599], ej.web.all.min.js

1 Reply

SK Saravana Kumar Kanagavel Syncfusion Team January 20, 2016 12:32 PM UTC

Hi Andrea Perazzolo,

Thanks for contacting syncfusion support. We have analyzed your query and replicated the scenario in our sample. We can able to reproduce the reported issue. We have logged issue report on this. For your better follow-up we have created the new branched incident in your account.

Please let us know if you have any concern.

Saravana Kumar K

Live Chat Icon For mobile
Up arrow icon