hansi
hansi

Reputation: 2298

Highcharts timeseries, X-axis min not working

I have a timeseries graph using highchart in JSFddle that is supposed to show data spread out over an entire day and in a specific timezone. Thus the min value should be the start and the max value the end of the day in that timezone.

Somehow the data is not displayed when both min and max value are used.

xAxis: {
   min: min,
   max: max,
   type: 'datetime',
},

Once I remove the min value the data is displayed. What's wrong with the min value?

JSFiddle

Upvotes: 0

Views: 1163

Answers (1)

beaver
beaver

Reputation: 17647

Use valueOf() on moment.js dates to obtain timestamps for min/max values:

xAxis: {
    // min/max must be timestamp
    min: min.valueOf(),
    max: max.valueOf(),
    type: 'datetime'
}

See jsfiddle updated: http://jsfiddle.net/beaver71/er4eLuaf/

Upvotes: 2

Related Questions