James
James

Reputation: 111

HighStocks Series Data format

I have an array of closing prices and an array of JS timestamps.

The HighStocks API says series.data should be a list of arrays with two values. The first value is the x value and the second is the y value. I have merged my two arrays into one array called timeClose using the timestamp as X and close price as Y like so :

timeClose : [ [1361750400000, 442.80] , [1361491200000, 450.81] ]

However the chart still does not work. Can anybody see what I am doing wrong?

Here is my code for the chart: http://jsfiddle.net/TqBvV/

Thanks

Upvotes: 2

Views: 1960

Answers (1)

StuR
StuR

Reputation: 12218

You need to plot the chart in the success callback of your Ajax request, otherwise there won't be any data to plot ;)

e.g:

$.ajax({
        url: ''
        success: function (data, status) {
//Render your chart in here
}
});

http://jsfiddle.net/rd13/TqBvV/1/

Upvotes: 1

Related Questions