Custom date parsing format
It would be really nice to have a custom date format option implemented in HighCharts / HighStock, so that it could parse dates from different sources.
In case it's useful, here's an example of how such feature is implemented in a couple of other JS popular libraries:
• http://momentjs.com/docs/#/parsing/
• http://c3js.org/reference.html (check "data-xFormat")
Cheers!
Highcharts by default requires integers in form of milliseconds since the Unix Epoch.
When using the data module however, you can add parsers either as a few predefined formats, or as a dateParser callback. See http://api.highcharts.com/highcharts#data.dateFormat.
-
Alessandro Zanardi commented
Thanks, I see. It would be useful if the data module could directly handle JSON data coming from a GET request. Possibly you could consider integrating this feature in future releases. Cheers!
-
The parseDate callback applies to the data module, and works only with CSV data, HTML tables, spreadsheets etc. Since you already have your data in a JavaScript form, all you have to do is a little preprocessing: http://jsfiddle.net/highcharts/vtu18w0z/
-
Alessandro Zanardi commented
Can you please help me understand why this doesn't work, and how to get it fixed?
Thanks!