Reputation: 1081
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
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