Danyal Sandeelo
Danyal Sandeelo

Reputation: 12391

Format used for date in Highcharts - Line with markers chart type

What kind of format has the date been converted to in https://www.highcharts.com/stock/demo/line-markers?

I am generating data but I need to convert the data into this format, strtotime doesn't seem to do the trick.

enter image description here

Upvotes: 0

Views: 39

Answers (2)

Core972
Core972

Reputation: 4114

You just need to multiply by 1000 the PHP timestamp to have a javascript timestamp

var jsTimestamp = 1545055048 * 1000

Upvotes: 1

Wojciech Chmiel
Wojciech Chmiel

Reputation: 7372

Highcharts documentation:

For datetime axes, the X value is the timestamp in milliseconds since 1970.

datetime axes data format:

[
   x value, - timestamp in milliseconds since 1970
   y value
]

Upvotes: 1

Related Questions