0

我正在尝试使用 x,y 对加载数据。我的 PHP 后端回显了一个看起来像嵌套数组的字符串,这是我应该做的吗?例如:

data1 = [0,0],[0,177],[000,2],[00,4],[1,1],[2.4157,4],[4,1],[5,3],[08 ,1],[12,1],[12.048,1],[13,1],[55.0541,1],[57.0697,1],[59.000,1],[59.01489482,1],[59.0599,1 ],[61.03929069,2],[67.0541,1],[69.0332,1],[69.07,1],[70,1],[70.94714329,1],[70.94721663,1],[71.01440325,1], [71.01441409,1],[71.0144472,1],[72.00979129,1],[72.94398353,1],[73.0892000,1],[74.00743457,1],[74.00757108,1],[74.00758939,1],[ ,2],[78.9590021,1],[78.95906314,1],[79.054,1],[79.9563,1],[79.96,3],[80.05989973,2],[81.0698,1],[083,2 ],[83.0491,1],[85.029,1],[86.0237,3],[86.096700,1],[87.00826664,1],[87.00831488,1],[88.0393,1],[88.03948568,1], [88.03949825,1],[88.50764976,4],[91.01570162,2],[91.0542,1],[92.051,1],[92.9270,1],[93.0696,1],[94.9241,1],[95.0853 ,1],[96.9211,1],[96.9595542,1],[96.96,2],[96.96830364,1];

(Highchart的东西......)

series: [{ name: 'Title1', //php 数组 data: [data1] //100 个点坐标数组 },{ name: 'Title2', //php 数组 data: data2 }]

4

1 回答 1

0

您需要将数据解析为数字,因为 Highcharts 不会重新识别字符串。

看一下关于预处理数据的文章:http: //docs.highcharts.com/#preprocessing

于 2013-06-18T10:12:01.663 回答