Uploaded image for project: 'ZK Charts'
  1. ZK Charts
  2. ZKCHARTS-80

NPE when using addSeriesAsDrilldown

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.2.1.1
    • 3.0.3
    • Security Level: Jimmy

      Steps to Reproduce

      run the attached example npeManualDrilldown.zul

      click any pie segment to drilldown

      Current Result

      the drill down visually works,
      but throws an exception

      17:01:19.104 [qtp1966124444-22] ERROR org.zkoss.zk.ui.impl.UiEngineImpl - 
      java.lang.NullPointerException: null
      	at org.zkoss.chart.Charts.service(Charts.java:2371)
      	at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:791)
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1309)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:487)
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:495)
      ...
      

      Expected Result

      no exception when using drilldown manually (e.g. when loading drilldown data from a DB on demand)

      Debug Info

      calling addSeriesAsDrilldown from an onPlotClick listener will trigger a different NPE since charts._drilldownLevels is not initializied

      Root Cause

      the list Charts.getDrillDown().getSeries() is not initialized

      Workaround

      initialize manually (e.g. in doAfterCompose)

      chart.getDrilldown().setSeries(); //sets an empty drilldown series collection
      

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h