I have a pie chart wherein I want to persist the in/visibility pie chart segments whose visibility has been toggled using the legend.
The problem is that on update of data, the whole pie chart would redraw. I tried handling this by keeping track of the invisible series:
plotOptionsParam.setPointLegendItemClickEventHandler(new PointLegendItemClickEventHandler() { @Override public boolean onClick(final PointLegendItemClickEvent pointLegendItemClickEvent) { String pointName = pointLegendItemClickEvent.getPointName(); if (invisibleSeries.contains(pointName)) { invisibleSeries.remove(pointName); } else { invisibleSeries.add(pointName); } return true; } });
...where "invisbleSeries" is an ArrayList<string>.</string>
In my event updating the points I have the ff code:
for (String key : invisibleSeries) //has to be done after all points have been updated { Point updatePoint = findPointWithName(series, key); if (updatePoint != null) { updatePoint.setOption("visible", false); } }
Somehow the segment still stays visible after this.
I'm not sure this is the right way of doing this, so any help will be appreciated.
Log in to post a comment.
I have a pie chart wherein I want to persist the in/visibility pie chart segments whose visibility has been toggled using the legend.
The problem is that on update of data, the whole pie chart would redraw. I tried handling this by keeping track of the invisible series:
...where "invisbleSeries" is an ArrayList<string>.</string>
In my event updating the points I have the ff code:
Somehow the segment still stays visible after this.
I'm not sure this is the right way of doing this, so any help will be appreciated.