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;
chart.redraw();
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