0
votes

I have a Highcharts line chart with multiple series. The X axis is a datetime axis. One series is a step line and the max data point for this can finish before the other series on the x axis, e.g. 5 days before the end.

Is there an easy way of extending this line to the end of the chart automatically without filling in the extra data points before the data is passed to Highcharts? The line should just carry on to the end of the chart at the same y coordinate as the last plotted point.

I have already tried setting minPadding and maxPadding to 0 along with start/endOnTick to false, but this had no effect.

Thanks!

1
@Mike91 If comment above doesn't resolve your problem, then please provide a live demo of your problem and of what you already tried. Minimal, working example will be the best.Kacper Madej
Thanks @jlbriggs! Initially this is what I wanted to do, however I ended up adding extra datapoints to achieve this in the backend code. Your answer did work though, so if you write it as an actual answer instead of a comment, then I will mark it as the correct answer!Mike91

1 Answers

1
votes

See answer here:

continue the line drawing on dotnet highchart

The basic idea is to

1) retrieve the final y value of your data

2) retrieve the final x value that you want it to extend until

3) add a new point to the data with those x and y values.