jQuery/JS图表 - 绘制不同颜色的线条取决于条件

Sam*_*iri 5 html javascript css jquery graph

我需要线图库,它支持移动应用程序的多色(最常见的是三种颜色).

例如: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
Run Code Online (Sandbox Code Playgroud)

所以我的图表应该如下,取决于葡萄糖水平.

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
Run Code Online (Sandbox Code Playgroud)

我浏览了Google Graphs和jqPlot,但似乎不走运,有人对此有何体验?

Sam*_*iri 3

最后,我找到了优秀的库,它解决了我的问题。称为流程图

通过分配阈值和逻辑,我们可以为同一条连续线获取不同的颜色。这里可以找到几个例子。