We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Chart background is not transparent on PPT

Hi,
What's wrong in this code?
When I put it into chart, the background remains white.
I thought NONE + transparency==1.0 should male fully transparent on ppt slide.

/////////////////////////////////////////// chart.getChartArea().setBackgroundMode(BackgroundMode.TRANSPARENT);
FillFormat fillFormat = chart.getChartArea().getArea().getFillFormat();
fillFormat.setPattern(FillPattern.NONE);
chart.getChartArea().getArea().setTransparency(1.0);
chart.getChartArea().getArea().setBackgroundColor(white);
chart.getChartArea().getArea().setForegroundColor(white);
chart.getPlotArea().getArea().setTransparency(1.0);
////////////////////////////////////////////

Hi,


I think you may try:

chart.getChartArea().getArea().setFormatting(FormattingType.NONE);

Thank you.

It doesn’t help. When I view the document in PP the chart/plot area of attached chart is black and not transparent (transparency 0, see example).

Send me, please, full example how to set all chart properties before attaching to ppt.

It doesn’t help. When I view the document in PP, the chart/plot area of attached chart is black and not transparent (transparency 0, see example).

Send me, please, full example how to set all chart properties before attaching to ppt.


chart.getChartArea().setBackgroundMode(BackgroundMode.TRANSPARENT);
FillFormat fillFormat = chart.getChartArea().getArea().getFillFormat();
chart.getChartArea().getArea().setFormatting(FormattingType.NONE);
fillFormat.setPattern(FillPattern.SOLID);
fillFormat.setSetType(FormatSetType.NONE);

chart.getChartArea().getArea().setBackgroundColor(someColor);
chart.getChartArea().getArea().setForegroundColor(someColor);
chart.getChartArea().getArea().setTransparency(1.0);

chart.getPlotArea().getArea().setTransparency(1.0);
Area legendArea = chart.getPlotArea().getArea();
legendArea.setTransparency(1.0);

Hi,


I have separated the part and use only Aspose.Cells for Java APIs to check your issue. I have extracted the Excel file from your template PPT file using my own code. Then, I tested, I loaded the Excel file by Aspose.Cells for Java APIs and then converted the chart in the second sheet to Image file, it works fine as per the original chart in the template file. I have attached the sample output image for your reference. In the output image, there is no black background at all, the image is similar to the original chart in the template file (attached), although I have taken one page for the long image to be rendered.

Sample code:
Workbook workbook = new Workbook(“chart_transparency.xls”);
Chart chart = workbook.getWorksheets().get(1).getCharts().get(0);
chart.toImage(“img_chart.bmp”);

Also, I am using our latest version of the product v7.0.3.6, please try this latest fix.

If you still find any issue, we need your complete runnable code (by only using Aspose.Cells APIs) to get the issue on our side, also attach the template Excel files here. We will check it soon.

Thank you.