-
Bug
-
Resolution: Fixed
-
Normal
-
7.2.2.0
-
None
Steps to Reproduce
run attached sample
click drill section (a)
click "change chart type" button
click drill section (a), click the "go back" button
Current Result
java.util.NoSuchElementException.
Expected Result
no exception
Debug Information
Caused by invalidate during setType
Charts.invalidate() line: 2530 Charts.invalidate() line: 2530 PlotData.onChange(OptionDataEvent) line: 367 Chart(Optionable).fireEvent(OptionDataEvent) line: 92 Chart(Optionable).fireEvent(EventType, String, Object, DeferredCall) line: 74 Chart(Optionable).fireEvent(EventType, PlotAttribute, Object) line: 56 Chart(Optionable).setAttr(PlotAttribute, Object, T) line: 204 Chart.setType(String) line: 1323 Charts.setType(String) line: 818
Invalidate contains
_drilldownLevels.clear()
Next call to Charts.services with the Drill down command will go through:
if (_drilldownLevels == null) { _drilldownLevels = new LinkedList<Series>(); _drilldownLevels.addFirst(evt.getSeries()); }
Since drilldownLevels is not null, it doesn't go in this conditional statement.
SInce it doesn't go in the conditional statement, the root level is never added to the drilldownLevels
When the drill up command is triggered, drill up removes the first entry in the drilldowns
if (ChartsEvents.ON_PLOT_DRILL_UP.equals(cmd)) {
_drilldownLevels.removeFirst();
At this point, the drilldowns should contain (at least) the last drill level and the root level.
Since the root level was never added, the _drilldownLevels is empty after this step, causing following line's
_drilldownLevels.getFirst();
to trigger a no element exception
Workaround
- relates to
-
ZKCHARTS-125 addSeriesAsDrilldown cause NPE if triggered before manual charts drilldown
- Resolved