0
我是新使用highchart隊wrks罰款這裏給出一個默認的JSON值highchart給輸入使用JSON
被鏈接
但然而,當我試圖給highchart輸入作爲JSON作爲局部變量表示在沒有任何圖形,這裏是代碼
var myval = new Array();
myval [0] = "1146096000000,69.36";
myval [1] = "1146182400000,70.39";
myval [2] = "1146441600000,69.60";
/******* OR ******/
//var myval = [ [1146096000000,69.36], [1146182400000,70.39], [1146441600000,69.60]];
/***** DOESN'T WORk *****/
var obj = jQuery.parseJSON (myval);
$.getJSON(obj, function(data) {
$('#container').highcharts('StockChart', {
rangeSelector : {
selected : 2
},
title : {
text : 'value graph'
},
series : [{
name : 'val 1',
data : data,
tooltip: {
valueDecimals: 2
}
}]
});
});
});
感謝它真的幫了很多,需要學習JSON的基本知識:( – yashhy 2013-04-26 08:31:31