我看过很多例子。然而,我仍然坚持这一点。如何解析此 JSON 响应以使用我的 Highstock Highchart?
[{"averageprice":"18.7","date":"2000-01-01"},{"averageprice":"41.73","date":"2000-01-02"},{"averageprice":"34.27","date":"2000-01-03"},{"averageprice":"30.06","date":"2000-01-04"}]
这是我到目前为止的图表...
$.getJSON('http://example.com/dailyaverages.json', function(data) {
// Create the chart
window.chart = new Highcharts.StockChart({
chart : {
renderTo : 'ppcontent'
},
rangeSelector : {
selected : 0
},
title : {
text : 'Trade Prices'
},
xAxis: {
type: 'datetime'
},
series : [{
data : data
}]
});
});