ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  NullPointerException with c.getJsChartModel()
Posted by Ludovic on May-13-2014 21:18
Hello,
could you explain me how c.getJsChartModel() works, because i use it in a java class, like in your jsp, but it throws a NullPointerException:

WebChartViewer wcv = new WebChartViewer((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(),
                "imgGraphe");
String chartQuery = c.makeSession(wcv.getRequest(), wcv.getId());
wcv.setImageUrl("/getChart.chart?" + chartQuery);
wcv.setChartModel(c.getJsChartModel());
graphe.getMiseEnForme().getInfo().setWcv(wcv);

i get:
java.lang.NullPointerException
at ChartDirector.ho.a(SourceFile:112)
at ChartDirector.ho.a(SourceFile:154)
at ChartDirector.DataSet.a(SourceFile:284)
at ChartDirector.Layer.a(SourceFile:1735)
at ChartDirector.PlotArea.a(SourceFile:1391)
at ChartDirector.XYChart.a(SourceFile:882)
at ChartDirector.BaseChart.getJsChartModel(SourceFile:1007)
at ChartDirector.BaseChart.getJsChartModel(SourceFile:1012)
       .......


Thanks for your help

Ludovic

  Re: NullPointerException with c.getJsChartModel()
Posted by Peter Kwan on May-13-2014 22:27
Hi Ludovic,

This is a known bug. It occurs if "null" is used as the data array. It should have already
been fixed in the latest patch as follows:

http://www.advsofteng.com/cdjava511p3.zip

Please use the "ChartDirector.jar" inside to replace your existing "ChartDirector.jar". Please
kindly let me know if this fixes the problem.

Regards
Peter Kwan

  Re: NullPointerException with c.getJsChartModel()
Posted by ludovic on May-13-2014 23:32
Thanks,
i'll try it and let you know.

Ludovic

  Re: NullPointerException with c.getJsChartModel()
Posted by ludovic on May-15-2014 15:01
Thanks,
i'll try it and let you know.

Ludovic

  Re: NullPointerException with c.getJsChartModel()
Posted by ludovic on May-16-2014 16:03
Hi Peter
c.getJsChartModel() now is working !

Thank you very much.
regards

Ludovic