HTML5 jaspersoft studio error for scatterr plot

0

HI,

 

I am using

Jaspersoft studio's latest version alonth scattered HTML5 plot whch is recently added?

I am tring to create custom chart (customizer) using HTML5 chart

But couldnt set tick intervel  and getting error

when i give yAxis.tickInterval and value 0.5

and my desired rane for Y is 0.00 to 5.00 (0.00, 0.50, 1,00.1.50 etc)

same this for X Axis

and desired scale shout be 0- 80 (0,10,20,30 etc)

 

net.sf.jasperreports.engine.JRRuntimeException: org.mozilla.javascript.EcmaError: TypeError: Cannot find function toPrecision in object 00.5. (script#22)
    at com.jaspersoft.jasperreports.highcharts.charts.ChartGraphics2DHandler.exportElement(ChartGraphics2DHandler.java:52)
    at net.sf.jasperreports.engine.export.draw.FrameDrawer.draw(FrameDrawer.java:247)
    at net.sf.jasperreports.engine.export.draw.FrameDrawer.draw(FrameDrawer.java:199)
    at net.sf.jasperreports.engine.export.JRGraphics2DExporter.exportPage(JRGraphics2DExporter.java:273)
    at net.sf.jasperreports.engine.export.JRGraphics2DExporter.exportReportToGraphics2D(JRGraphics2DExporter.java:246)
    at net.sf.jasperreports.engine.export.JRGraphics2DExporter.exportReport(JRGraphics2DExporter.java:184)
    at net.sf.jasperreports.eclipse.viewer.ViewerCanvas.renderPage(ViewerCanvas.java:369)
    at net.sf.jasperreports.eclipse.viewer.ViewerCanvas.refresh(ViewerCanvas.java:344)
    at net.sf.jasperreports.eclipse.viewer.ViewerCanvas$2.viewerStateChanged(ViewerCanvas.java:118)
    at net.sf.jasperreports.eclipse.viewer.ReportViewer.fireViewerModelChanged(ReportViewer.java:383)
    at net.sf.jasperreports.eclipse.viewer.ReportViewer.setPageIndex(ReportViewer.java:297)
    at com.jaspersoft.studio.editor.preview.view.report.swt.SWTViewer.setJRPRint(SWTViewer.java:125)
    at com.jaspersoft.studio.editor.preview.view.report.swt.SWTViewer.setJRPRint(SWTViewer.java:112)
    at com.jaspersoft.studio.editor.preview.PreviewJRPrint.switchRightView(PreviewJRPrint.java:226)
    at com.jaspersoft.studio.editor.preview.PreviewContainer.switchRightView(PreviewContainer.java:247)
    at com.jaspersoft.studio.editor.preview.PreviewJRPrint$3.switchView(PreviewJRPrint.java:194)
    at com.jaspersoft.studio.editor.preview.PreviewJRPrint$1.run(PreviewJRPrint.java:153)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at com.jaspersoft.studio.pro.rcp.JSSProApplication.start(JSSProApplication.java:112)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot find function toPrecision in object 00.5. (script#22)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3785)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3763)
    at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3791)
    at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3810)
    at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3881)
    at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2360)
    at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2327)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_correctFloat_40(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:872)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_244(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:6818)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_251(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:7245)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_255(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:7367)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_407(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:10786)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.NativeArray.iterativeMethod(NativeArray.java:1563)
    at org.mozilla.javascript.NativeArray.execIdCall(NativeArray.java:345)
    at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
    at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2521)
    at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:300)
    at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
    at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_51(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:1101)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_406(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:10785)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_415(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:11016)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_anonymous_420(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:11074)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3._c_Chart_350(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js:9657)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_highcharts_bbox_js_3.call(com.jaspersoft.jasperreports.highcharts.highcharts.bbox.js)
    at org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:369)
    at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2440)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_render_svg_renderer_highcharts_js_2._c_renderSVGFromJson_4(com.jaspersoft.jasperreports.highcharts.render.svg-renderer-highcharts.js:59)
    at org.mozilla.javascript.gen.com_jaspersoft_jasperreports_highcharts_render_svg_renderer_highcharts_js_2.call(com.jaspersoft.jasperreports.highcharts.render.svg-renderer-highcharts.js)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
    at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
    at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
    at com.jaspersoft.jasperreports.highcharts.charts.render.RhinoChartSvgProducer.getChartSvg(RhinoChartSvgProducer.java:87)
    at com.jaspersoft.jasperreports.highcharts.charts.render.DefaultChartSvgProducer.getChartSvg(DefaultChartSvgProducer.java:39)
    at com.jaspersoft.jasperreports.highcharts.charts.render.ChartSvgImageProducer.createRenderable(ChartSvgImageProducer.java:81)
    at com.jaspersoft.jasperreports.highcharts.charts.render.ChartSvgImageProducer.getChartImage(ChartSvgImageProducer.java:45)
    at com.jaspersoft.jasperreports.highcharts.charts.ChartGraphics2DHandler.exportElement(ChartGraphics2DHandler.java:47)
    ... 40 more
 

 

Attachments: 
rakesh.shelar's picture
Joined: Jul 17 2013 - 11:45pm
Last seen: 6 years 7 months ago

I can reproduce this condition pretty easily in Jaspersoft Studio 5.6 on both a Linux OS (Ubuntu 14.04) and Windows 8.1. 

In either case, it appears impossible to set interval ticks for the y-axis through the Jaspersoft integration of the highcharts charts.

Can anyone demonstrate the use of the yAxis.tickInterval property?

Thanks

 

 

richbl - 6 years 3 months ago

1 Answer:

1

So it turns out that the answer was that the jrxml syntax expects a different syntax than is created if you simply enter an integer value. I'm not sure why some highchart values are accepted directly, while others are not... In any case...

The expected syntax (view the source tab of the *.jrxml file):

<hc:chartProperty name="yAxis.tickInterval" value="10"/>

This will fail (as you've indicated in the initial post).

The proper syntax is as follows:

<hc:chartProperty name="yAxis.tickInterval"><hc:propertyExpression>
<![CDATA[new Integer(10)]]>
</hc:propertyExpression></hc:chartProperty>

richbl's picture
39
Joined: May 22 2014 - 7:14pm
Last seen: 3 years 4 weeks ago
Feedback
randomness