我正在尝试使用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] [75.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的东西......)
系列:[{ name:'Title1',// php array data:[data1] // 100个点坐标数组 },{ 名称:'Title2',// php数组 数据:data2 }]
答案 0 :(得分:0)
您需要将数据解析为数字,因为Highcharts不会重新协调字符串。
查看artcile abour预处理数据:http://docs.highcharts.com/#preprocessing