Waterfall Chart Is Displayed Incorrectly after Restoring PPTX from ByteArrayOutputStream

Hi Aspose Slides Team,

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;

public class TestColumnChart {

  public static void main(String[] args) {
    String path = "C:\\Users\\"; //replace the path wrt your machine
    Presentation presentation = new Presentation(path + "OriginalFile.pptx");
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    presentation.save(baos, SaveFormat.Pptx);
    System.out.println(baos);
    Presentation tmpPresentation = new Presentation(new ByteArrayInputStream(baos.toByteArray()));
    tmpPresentation.save(path + "ByteArrayConvertedFile.pptx", com.aspose.slides.SaveFormat.Pptx);
  }
}

With the above Program, we are trying to read an already saved PPT file, save it in ByteArrayOutputStram and saving it again as a pptx file.

Name of the Original file used is “OriginalFile.pptx”
And the PPT looked like
image.png (18.8 KB)

Name of the File after converting to byte array and saving to a new powerpoint → “ByteArrayConvertedFile.pptx”

And the converted file looks like
image.png (10.1 KB)

We noticed here that the Y axis labels are coming up and the last bar datalabel is missing here.
We have a requirement to save the file as ByteArray and then reconstruct the file again. And It’s causing issue . Could you please check and update ?

System Configurations:
OS: Windows 10 - 64Bit
CPU & RAM: Intel(R) Core™ i7-10610U & 16GB (JVM Heap Size given is 1GB)
JDK & Aspose.slides: [ Aspose.slides 25.6 with JDK 21 ]
ByteArrayConvertedFile.zip (85.5 KB)

@VaradS

It appears you are encountering issues with a waterfall chart after saving a PowerPoint presentation to a byte array and then reconstructing it. Specifically, the Y-axis labels are visible, but the last data label for the bar is missing in the converted file.

This issue may stem from how the chart data is serialized and deserialized during the conversion process. Here are several steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Chart Data: Verify that the chart data in the original presentation is correctly configured. Missing data labels can often result from how the data is structured.

  2. Update Aspose.Slides: Ensure you are using the latest version of Aspose.Slides. If you are on version 25.6, check for any updates or patches that may address chart rendering issues.

  3. Recreate the Chart: If the issue persists, consider programmatically recreating the chart after loading the presentation from the byte array. This can help ensure that all properties are correctly set.

  4. Debugging: Implement logging to check the properties of the chart after loading it from the byte array. This can help identify if any properties are missing or incorrectly configured.

Here’s a minimal code snippet to assist you in recreating the chart after loading the presentation:

// After loading the presentation from ByteArrayInputStream
ISlide slide = tmpPresentation.getSlides().get_Item(0);
IChart chart = (IChart) slide.getShapes().get_Item(0); // Assuming the chart is the first shape

// Recreate or update the chart data as needed
chart.getChartData().getSeries().get_Item(0).getDataLabels().setShowValue(true);

If these steps do not resolve the issue, consider reaching out to the Aspose support team with specific details of your problem, including the original and converted files for further assistance.

Please let me know if you have any further questions!

@VaradS,
Thank you for reporting the issue. I was unable to produce exactly the same result, but the output also looks incorrect. We apologize for any inconvenience caused.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39742

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi @andrey.potapov ,
Will you be able to confirm if the fix will provided as a part of major aspose release or it will be patch?

@VaradS,
The fix will be included in an Aspose.Slides release. Our developers will do their best to resolve the issue as soon as possible.