在 javascript / html5 中可以有具有不规则数据系列(不是时间序列)的折线图吗?有图书馆吗?
我需要一个基于 javascript (HTML4/5) 的库来绘制具有不规则数据(以及一个或多个系列)的折线图。
下面是一个示例:
x-axis = [1, 2, 3, 4, 5, 6, 7, 8]
series1 (y-axis) = [6, 10, null, 8, null, 7, 6, 4]
series2 (y-axis) = [null, 8, 8, null, 1, 3, 5, 4]
在此图表中,不考虑空值;以某种方式“跳过”,该行直接进入下一个值。当然,我想突出显示这些点,以了解某个点是否存在于该 x 值处。
其中一些图表具有基于时间序列的不规则数据(例如 highcharts.com/demo/spline -irregular-time),但我需要定义我自己的(常规)x 轴。
你有什么建议?
I need a javascript (HTML4/5) based library to draw a line chart that has irregular data (and one or more series).
Here is an example:
x-axis = [1, 2, 3, 4, 5, 6, 7, 8]
series1 (y-axis) = [6, 10, null, 8, null, 7, 6, 4]
series2 (y-axis) = [null, 8, 8, null, 1, 3, 5, 4]
In this chart the nulls are not taken in consideration; are in some way "skipped" and the line goes directly into the next value. Of course i want to highlight the points to know if a point is or isn't there at that x value.
There are some of this charts with irregular data based on time series (like this highcharts.com/demo/spline-irregular-time) but i need that defining my own (regular) x-axis.
What do you suggest?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Highcharts 可以接受不规则数据而不使用时间。
基本上,您采用您发布的示例,删除
type: 'datetime'
选项,并指定数字而不是系列中的日期。我在这里发布了一个示例: http://jsfiddle.net/TRLhc/
Highcharts can accept irregular data without using times.
Basically, you take the example that you posted, and remove the
type: 'datetime'
option, and specify numbers instead of dates in the series.I have posted an example here: http://jsfiddle.net/TRLhc/