Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding point always appends instead of placing in the middle #1109
It'd be great to have a function that would just not append the point to the series, and rather insert it at a particular index or x value.
You can add points at a given x value. If an x value is not given, the point is appended.
Expected: the new point to be spliced into the middle of the data
@highslide-software I think you've misunderstood the question. Adding a point at a particular x is not the problem.
This works fine, but then is quite slow on older browsers when we have around 5 years of data.
referenced this issue
Feb 12, 2013
I was able to get some part of the way by splicing in the new point instead
However it seems like the point is not picked up...
After some research and experimentation, this seems to work for me. Anybody see issues with this?
added a commit
Sep 4, 2013
Ran into an issue with this today with the latest release (of yesterday). The revised addPoint() function doesn't work in that while it places the new point in the correct spot, all points to the right of the new point are missing. Examining the series.data array at the end of addPoint(), I see a null in the middle of the array, at the insertion point.
The hcInsertPoint function above still works if
Not sure what's wrong here.
Further investigation of my problem with addPoint() in the middle of a series leads me to this line in addPoint():
Which, in updateParallelArrays(), results in the series.[x|y]Data being truncated at i in the splice call. If I change this call to:
Then things work as desired. Probably not the best approach, but seems to resolve my issue.