Chart Tag Chart Requests Series Named but Not Found from Given Data

Hi, we are using Aspose.slides for generating presentations. Currently we are using aspose.slides 17.7 version and planning to upgrade to 24.9 version
However while testing with the trail version for 24.9 , we observed that there is an issue with the chart.

This is the error log:

“executionException”: “java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: In slide No 23, chart tag chart requests series named but not found from given data!\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)\n\tat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\n\tat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)\n\tat java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:562)\n\tat java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:591)\n\tat java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:689)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173)\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)\n\tat java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)\n\tat com.linkedin.mw.core.pptx.service.PPTXExecutionService.executePresentation(PPTXExecutionService.java:70)\n\tat com.linkedin.mw.engine2.service.AsyncExecutionService.generatePresentation(AsyncExecutionService.java:697)\n\tat com.linkedin.mw.engine2.service.AsyncExecutionService.executePptxRequest(AsyncExecutionService.java:371)\n\tat com.linkedin.mw.engine2.service.AsyncExecutionService.executeUserRequest(AsyncExecutionService.java:310)\n\tat com.linkedin.mw.engine2.service.AsyncExecutionService.submitExecutionRequest(AsyncExecutionService.java:240)\n\tat com.linkedin.mw.engine2.service.AsyncExecutionService$$FastClassBySpringCGLIB$$62fd3bc1.invoke()\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)\n\tat org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\nCaused by: java.lang.RuntimeException: java.lang.RuntimeException: In slide No 23, chart tag chart requests series named but not found from given data!\n\tat com.linkedin.mw.core.pptx.service.PPTXExecutionService.lambda$executePresentation$0(PPTXExecutionService.java:75)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)\n\tat java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)\n\tat java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)\n\tat java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:711)\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)\n\tat java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)\n\tat java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)\nCaused by: java.lang.RuntimeException: In slide No 23, chart tag chart requests series named but not found from given data!\n\tat com.linkedin.mw.core.pptx.service.PPTXChartExecutionService.applyChartData(PPTXChartExecutionService.java:129)\n\tat com.linkedin.mw.core.pptx.service.PPTXChartExecutionService.updateChartShape(PPTXChartExecutionService.java:98)\n\tat com.linkedin.mw.core.pptx.service.PPTXChartExecutionService.executeChartShape(PPTXChartExecutionService.java:77)\n\tat com.linkedin.mw.core.pptx.service.PPTXExecutionService.executeShapes(PPTXExecutionService.java:170)\n\tat com.linkedin.mw.core.pptx.service.PPTXExecutionService.executeSlide(PPTXExecutionService.java:86)\n\tat com.linkedin.mw.core.pptx.service.PPTXExecutionService.lambda$executePresentation$0(PPTXExecutionService.java:72)\n\t… 12 more\n”,
“processStartTs”: 1736476209504,
“completed”: false,
“failed”: true
}

Code files attached.
Archive.zip (4.8 KB)

Also please note that the issue happens once in a while and not reproducible with just few slides. If we have more than 20 slides then the issue happens, so it is something related to race condition probably. But the same code works with the older version of aspose

@anilgudla

The error message you are encountering indicates that there is a chart in slide number 23 that is requesting a series name that cannot be found in the provided data. This issue often arises when the chart’s data series are not correctly defined or when the data source does not contain the expected series names.

To troubleshoot and resolve this issue, you can follow these steps:

  1. Check Chart Data: Ensure that the data being used for the chart is correctly set up. Verify that the series names you are trying to reference in your chart actually exist in the data source.

  2. Update Series Names: If you are modifying the chart data programmatically, make sure that you are updating the series names correctly. For example, when you modify the series names in the chart data workbook, ensure that the names match what the chart is expecting.

  3. Review Example Code: You can refer to the provided example code for updating existing charts. This code demonstrates how to access a chart, modify its series names, and update the data points. Here’s a simplified version of how you might modify a chart:

    // Access the presentation
    Presentation pres = new Presentation("path_to_your_presentation.pptx");
    ISlide slide = pres.getSlides().get_Item(0);
    IChart chart = (IChart) slide.getShapes().get_Item(0);
    IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();
    
    // Update series names
    IChartSeries series = chart.getChartData().getSeries().get_Item(0);
    fact.getCell(0, 0, 1, "Updated_Series_Name"); // Update series name
    series.getDataPoints().get_Item(0).getValue().setData(100); // Update data point
    
  4. Check for Empty Series Names: The error message suggests that a series name is being requested but is empty. Ensure that all series names are properly defined and not left blank.

  5. Upgrade Considerations: Since you are upgrading from version 17.7 to 24.9, check the release notes for any breaking changes or updates related to chart handling that might affect your implementation.

If the issue persists after checking these points, consider providing more details about how the chart data is being set up or any specific code snippets that might help in diagnosing the problem further.

Sources: