How to add lines between individual data points?

2019-07-19 06:34发布

问题:

I'm trying to make a scatter plot in Highcharts that only connects two individual points to each other, but doesn't connect to any other points. (To show the change in a data point over time).

Here I illustrate my question. I'd like for there to be a line between the points

[20, 20] and [80, 80]

and a separate line connecting

[60, 40] to [85, 60]

but no line connecting

[80, 80] to [60, 40]

Is there an easily configurable way to do this, or do I have to manually render each line?

回答1:

You can simple add null between these points.

data: [[20, 20], [80, 80], null, [60, 40], [85, 60]]

Demo



标签: highcharts