adding series to highcharts from JSON

Viewed 22103

I'm trying to add a series to a highcharts chart from JSON data. The json has dates and y values:

{Date.UTC(2011,8,1): 47, Date.UTC(2011,8,2): 78}

and the javascript function I currently have, which adds the series but the dates don't seem to work, is:

function requestData() {
$.ajax({
    url: 'chartData.php',
    success: function(items) {

        var series = {
            id: 'series',
            name: 'JSON Data',
            data: []
            }

        $.each(items, function(itemNo, item) {
            series.data.push(item);
        });

        chart.addSeries(series);

    },
    cache: false
});
 }

Can anyone help me finish off this query to get the chart working? Thanks in advance for the help!

EDIT: I SOLVED THIS - SEE ANSWER BELOW FOR HOW I DID IT

3 Answers
Related