Subodh Nijsure
Subodh Nijsure

Reputation: 3453

What is the format of 'date' when for highchart?

I am constructing JSON data structure in python and passing it to Highcharts.StockChart but I can't seem to figure out what format date/timestamp has to be.

Here is how JSON data looks like:

  {'chart_data': {'dates': ['07/29/14 23:50', '07/29/14 23:45' ], 
                    'values': [ {'data': [59, 72] } ] 
    }

FWIW - I am generating timestamp using this function in python

    myData['dates'].append(r.event_time.strftime('%m/%d/%y %H:%M'))

I also tried to pass dates as 'integers' 'dates': ['1406703000', '1406702700', ] but none of these are producing the right time of timestamps. What exactly is the format of timestamp expected when showing time-series data using highchart?

Upvotes: 0

Views: 211

Answers (1)

Sebastian Bochan
Sebastian Bochan

Reputation: 37578

Your datas should be multiplied by 1000, and order ascending. Obviously you can get your json by javascitrp and parse all dates.

Upvotes: 1

Related Questions