ps0604
ps0604

Reputation: 1081

Highcharts chart doesn't show all data points in X axis

This Highcharts chart is an area with three data points showing a time series. The X axis shows only the first two dates, how to make the third appear?

Javascript

   var settings = { 
       "chart": { "type":"area"},
       "series":[ {"name":"series1",
                  "data":[[Date.UTC(2017,8,30),14],
                          [Date.UTC(2017,9,31),35],
                          [Date.UTC(2017,10,30),62]]}],
        "xAxis": {
            type: 'datetime',
            "labels":{"format":"{value:%m-%d-%Y}"}
        }
    };
    $('#container').highcharts(settings);

Upvotes: 0

Views: 2095

Answers (1)

morganfree
morganfree

Reputation: 12472

Set axis.endOnTick to true.

var settings = { 
   "chart": { "type":"area"},
   "series":[ {"name":"series1",
              "data":[[Date.UTC(2017,8,30),14],
                      [Date.UTC(2017,9,31),35],
                      [Date.UTC(2017,10,30),62]]}],
    "xAxis": {
        type: 'datetime',
        "labels":{"format":"{value:%m-%d-%Y}"},
        endOnTick: true
    }
};
$('#container').highcharts(settings);

Upvotes: 1

Related Questions