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

NPE when using addSeriesAsDrilldown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 3.0.3
    • Fix Version/s: 7.2.1.1
    • Security Level: Jimmy
    • Labels:

      Description

      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
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rudyhuang rudyhuang
              Reporter:
              cor3000 cor3000
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

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