2011-10-20 51 views
5

我需要支持多種顏色(最可能是三種顏色)的移動應用程序的線圖庫。jQuery/JS圖形 - 繪製不同顏色的線條取決於條件

例如:y軸稱爲葡萄糖和50 -600範圍內,則x軸日期,一個月的憤怒(所以始終範圍爲每天30分)

邏輯:考慮x軸開始從

1st and level of glucose is 70 
2nd - 80 
… 
… 
… 
9th - 300 
10th – 350 
… 
… 
… 
15th – 500 
16th – 550 
… 
… 
… 
25th – 120 
26th – 130 

所以我的圖應繪製如下,取決於血糖水平。

50 – 150 - low – and line color should be green 
151 – 300 – average – line color should be orange 
Above 301 – high – line color should be red 

我經歷了Google Graphs和jqPlot,但似乎不吉利,有誰在這方面的經驗?

回答

3

最後,我發現優秀的lib,這解決了我的問題。稱爲Flot Chart

通過分配閾值和邏輯,我們可以獲得不同的顏色到同一個繼續線。有幾個例子可以發現here

相關問題