I've been trying to insert min and max string dates into my highcharts graph as follows:
var formatted_startDate = startDate.replace(/-/g, ",");
var formatted_endDate = endDate.replace(/-/g, ",");
//Format now is "yyyy,mm,dd"
options = {
chart: {
renderTo: 'container',
type: 'bar'
},
xAxis: {
type: "datetime",
dateTimeLabelFormats: {
day: '%m-%d'
},
tickInterval: 24 * 3600 * 1000,
min: Date.UTC(formatted_startDate),
max: Date.UTC(formatted_endDate)
},
Clearly the above won't work because I'm passing in a string. I've just written it like this to illustrate what I am trying to do rather than post code of numerous failed attempts. I've attempted using JSON.parse and eval() but had problems with the syntax.
Any help would be appreciated. Cheers
ended up just uses the setExtremes method within highcharts API