Issue with Chart Rendering with in a Table with Aspose.Slides for Java 24.9

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 rendering. Previously(with version 17.7) we didnt have this issue, but with the new version of aspose(24.9), the charts not rendering correctly and displaying duplicate bars.
Want to know what is causing this and how to fix this, this is one of the blocker for us to move forward with this new version of library.
Added the images of the chart config and the chart that is displayed

This is the chart config that was working with previous version of aspose
Screenshot 2025-01-09 at 1.16.44 PM.png (51.2 KB)

This is how the chart is displayed right now with new version
image (3).png (29.3 KB)

This is how the chart is displayed with the old version
image (4).png (30.6 KB)

We did check that if we change the chart config to below, then the charts are displayed properly with new version of aspose
Screenshot 2025-01-09 at 1.18.46 PM.png (20.6 KB)

So even though there is an alternative for us, this is an issue that needs to be fixed since we need to change our chart config for all of our charts which is a huge task

@anilgudla,
Thank you for describing the issue. Could you please also share a code example to reproduce the problem on our end?

Hi @andrey
Its a significant effort to separate the logic to share. Based on the screenshot provided can you configure a chart on your end and reproduce ? Let me know if you are available for a call to discuss these issues which are a blocker for our upgrade to the new version , we are planning to purchase the new version by this month end.

@anilgudla,
I need some time to perform some research. I will get back to you soon.

Thanks @andrey
Adding code snippet for easier debugging

 private void applyChartData(IChart chart, ChartData chartData, int slideNo, Tag chartTag, List<Log> executionLog) {
    Map<IChartSeries, List<IFormat>> highlightDataPointFormats = getHighlightDataPointFormats(chart);
    cleanChartData(chart);
    IChartCategoryCollection categories = chart.getChartData().getCategories();
    IChartSeriesCollection series = chart.getChartData().getSeries();
    IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook();

    Object cellValue = wb.getCell(0, 0, 0).getValue();
    String categoryName = (cellValue == null) ? "CATEGORY_NOT_FOUND" : cellValue.toString();
    IChartSeries currentSeries;
    IChartDataPointCollection dataPoints;
    int wbIndex = 0;
    List<Map<String, String>> data = chartData.getChartData();
    Map<String, String> element;
    for (int i = 0; i < data.size(); i++) {
      element = data.get(i);
      int row = i + 1;
      categories.add(wb.getCell(wbIndex, row, 0, element.get(categoryName)));
      for (int j = 0; j < series.size(); j++) {
        currentSeries = series.get_Item(j);
        dataPoints = currentSeries.getDataPoints();

        String val = element.get(currentSeries.getName().toString());
        if (val == null) {
          String msg =
              String.format("In slide No %s, chart tag %s requests series named %s but not found from given data!",
                  slideNo, chartTag, currentSeries.getName());
          executionLog.add(new Log(Log.LogType.ERROR, slideNo, chartTag.toString(), msg));
          throw new RuntimeException(msg);
        }
        Object parseVal;
        try {
          parseVal = Double.parseDouble(val);
        } catch (NumberFormatException e) {
          // cannot parse into double number, fallback to string value.
          parseVal = val;
        }
        IChartDataCell cell = wb.getCell(wbIndex, row, j + 1, parseVal);

        if (ChartTypeCharacterizer.isChartTypeLine(currentSeries.getType())) {
          dataPoints.addDataPointForLineSeries(cell);
        } else if (ChartTypeCharacterizer.isChartTypeBar(currentSeries.getType())) {
          dataPoints.addDataPointForBarSeries(cell);
        } else if (ChartTypeCharacterizer.isChartTypeArea(currentSeries.getType())) {
          dataPoints.addDataPointForAreaSeries(cell);
        } else if (ChartTypeCharacterizer.isChartTypeBubble(currentSeries.getType())) {
          throw new ChartTypeNotImplementedException("bubble");
        } else if (ChartTypeCharacterizer.isChartTypeColumn(currentSeries.getType())) {
          dataPoints.addDataPointForBarSeries(cell);
        } else if (ChartTypeCharacterizer.isChartTypeDoughnut(currentSeries.getType())) {
          dataPoints.addDataPointForDoughnutSeries(cell);
        } else if (ChartTypeCharacterizer.isChartTypePie(currentSeries.getType())) {
          dataPoints.addDataPointForPieSeries(cell);
        } else if (ChartTypeCharacterizer.isChartTypeRadar(currentSeries.getType())) {
          dataPoints.addDataPointForRadarSeries(cell);
        } else if (ChartTypeCharacterizer.isChartTypeScatter(currentSeries.getType())) {
          throw new ChartTypeNotImplementedException("scatter");
        } else if (ChartTypeCharacterizer.isChartTypeStock(currentSeries.getType())) {
          throw new ChartTypeNotImplementedException("stock");
        } else if (ChartTypeCharacterizer.isChartTypeSurface(currentSeries.getType())) {
          dataPoints.addDataPointForSurfaceSeries(cell);
        } else {
          throw new ChartTypeNotImplementedException("unknown chart type: " + currentSeries.getType());
        }

        /*
        Check if the element has specified using highlight format
         */
        List<IFormat> formatList = highlightDataPointFormats.get(currentSeries);
        String highlight = element.get(HIGHLIGHT_FORMAT);
        if (formatList != null && highlight != null && !highlight.isEmpty()) {
          /*
          Set the highlight format only if it's defined in template && specified in the request
           */
          try {
            int index = Integer.valueOf(highlight);
            dataPoints.get_Item(i).setFormat(formatList.get(index));
          } catch (NumberFormatException e) {
            throw new RuntimeException("Failed to get the highlight specification from dynamic content.", e);
          } catch (IndexOutOfBoundsException e1) {
            throw new RuntimeException(
                "Highlight specification exceed the boundary defined in template for series " + currentSeries.getName(),
                e1);
          }
        }
      }
    }
  }

@anilgudla,
Thank you for the code snippet. I am working on the issue and will get back to you soon.

Hi @andrey.potapov Thank you, any update you have ?

@anilgudla,
I need some time to check the issue. I will get back to you later.

@anilgudla,
Thank you for your patience. Unfortunately, I could not use your sample code to test the issue. Please try to isolate the problem and share the following:

  • input and output presentation files
  • standalone code example