Hello,
We had (with your help) dateTimeFormatter() working with rangeChanging to modify the format of xAxis labels based on zoom level.
Client then insisted on setting interval and intervalType during initial load of chart based on the number of years.
axisXOption{} is set at highest scope. Then when chart is drawn by drawchart() I have now added
if (years == 0) {
axisXOption.intervalType = 'year';
axisXOption.interval = 3;
} else if (years == 1 || years == 2) {
axisXOption.intervalType = 'month';
axisXOption.interval = 1;
} else if (years == 3) {
axisXOption.intervalType = "month";
axisXOption.interval = 3;
} else if (years == 5) {
axisXOption.intervalType = "month";
axisXOption.interval = 6;
}
That does set up the initial labels as required. However now when zoom occurs the xAxis labels and gridlines are removed.
The issue can be seen here in this JSFiddle.
Can you help me see why that occurs?
Thank you!!