Set JSON data


Download this sample
Download AnyChart Trial

Data Loading:

function onDataLoad(xmlhttp) {
    var stringData = "("+xmlhttp.responseText+")";
    var JSONData = eval(stringData);
    chart.setJSData(JSONData);
}
getData("json-data.txt", onDataLoad);

json-data.txt content:

{
    "charts": {
        "chart": {
            "chart_settings": {
                "title": {
                    "text": "Simple Chart"
                }
            },
            "data": {
                "series": [
                    {
                        "point": [
                            {"name": "Jan", "y": 21},
                            {"name": "Feb", "y": 23},
                            {"name": "Mar", "y": 31},
                            {"name": "Apr", "y": 34},
                            {"name": "May", "y": 45}
                        ]
                    }
                ]
            }
        }
    }
}