I have a highchart and I simply want to remove a bar from it. Sounds simple, but the remove() method works differently depending on which data point I access.
Something like…
chart.series[0].data[0].remove();
…works nicely. Removes the bar and the category associated with the bar. Now a small change:
chart.series[0].data[1].remove();
and while the bar is removed the category is not. Trying to modify the categories and use setCategory does not alleviate the issue.
Please see: http://jsfiddle.net/FxY63/2/
What kind of magic do I need to cast to so that pressing “Remove Point 2” properly cleans up the categories array and leaves the correct number of tics on the y-axis?
This appears to be the only solution I could come up with from my searching. Storing your categories and data into arrays, and depending on the index you want to remove splice the data/category out of the arrays and re-set the category/data to the chart causing it to redraw with the new data.
Fiddle Demo: http://jsfiddle.net/3dcbY/