Free Support Forum - aspose.com

Converting chart to image online example exception

Hi,

I put the code from the following URL into a unit test, ran it then got the exception below.

I've zipped up the unit test and attached it. It's using apsose-cells-2.5.4.jar

http://www.aspose.com/documentation/java-components/aspose.cells-for-java/converting-chart-to-image.html

java.lang.IllegalArgumentException: Invalid Chart data: Data!B2:B8
at com.aspose.cells.NSeries.a(Unknown Source)
at com.aspose.cells.NSeries.add(Unknown Source)
at org.test.asposejava.ChartTest.testOnlineChartToImageExample(ChartTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Am I doing something wrong?

Kind regards.

Éamonn

Hi,


Sorry for a minor mistake, we will fix it in the online document.

Please change the line of code i.e.:
//Set the name of worksheet
sheet.setName(“Chart”);
to:
//Set the name of worksheet
sheet.setName(“Data”);

Thank you.

Hi,


And, please check the online document, the issue is fixed now:
http://www.aspose.com/documentation/java-components/aspose.cells-for-java/converting-chart-to-image.html

thanks and have a good time!