2014-03-25 83 views
0

我有一個PHP腳本(data.php)是從一個MySQL數據庫返回以下JSON數據:Highcharts玫瑰圖與JSON

[[0,0.35,0,1.05,1.05,0.7,0.35], 
[0,0.7,0,1.05,1.74,1.74,0], 
[0,2.09,0,0.7,2.09,1.05,0.35], 
[0.35,1.74,0,1.05,1.05,1.05,0.35], 
[0.7,0.7,0,1.05,1.74,1.05,0.35], 
[0,1.05,0,2.09,2.09,1.39,0.7], 
[0,1.39,0,1.39,0.7,1.39,0.7], 
[1.05,1.05,0,1.05,0.35,1.05,0.35], 
[0,1.39,0,0.7,0.7,0.35,0.7], 
[0.35,0.7,0,0.7,0.35,1.39,0.7], 
[0,2.09,0,1.05,1.74,1.05,0], 
[0,1.05,0,1.05,1.05,0.7,0.35], 
[0.35,1.05,0,1.74,1.74,1.39,0.35], 
[0,1.05,0,1.39,1.74,1.05,0.35], 
[0,1.39,0,1.39,0.7,0,0.35], 
[0,0,0,1.74,2.09,0.35,0.35]] 

我現在想使用該數據與highcharts玫瑰圖的例子,但我努力工作得到顯示的數據。

任何highchart/json專家都在幫忙嗎?

jsfiddle

+0

出了什麼事?你有任何錯誤? – aldux

+0

我沒有得到任何數據顯示在頁面上,但後來我不認爲我採取了這個例子,並將其轉換爲正確使用json。 – Greg

回答

1

你需要分析你的數據並返回各行作爲簡單的串聯,才達到這個數字:

series: [{ 
     data: [0, 0.35, 0, 1.05, 1.05, 0.7, 0.35] 
    },{ 
     data: [0, 0.7, 0, 1.05, 1.74, 1.74, 0], 
    }] 

http://jsfiddle.net/5ky4g/1/