Home Forums Chart Support Losing my xAxis labels

Losing my xAxis labels

Viewing 3 posts - 1 through 3 (of 3 total)
  • #15935

    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!!

    #15947

    Kathy,

    On calling the rangeChanging event handler mention the intervalType and interval in each of the individual conditions.

    Please take a look at this solution.

    ____________
    Indranil Deo,
    Team CanvasJS

    • This reply was modified 7 years, 3 months ago by Indranil.
    • This reply was modified 7 years, 3 months ago by Indranil.
    #15953

    Thank you! I had tried that but I guess I must have done it incorrectly. Very much appreciate your help!!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.