Does anyone knows how to make the chart body to be transparent?

Hello,

I’d like to save a chart to SVG file but need it’s body to be transparent (in below chart, I need the white part to be transparent):
图片.png (5.0 KB)

I use ImageOrPrintOptions.setTransparent(true) method but it seems doesn’t work.

What shall I do?

Thanks.

@marksmancl
Based on the image you provided, we have created a sample file. You can refer to the following sample code to achieve the goal. Please refer to the attachment. result.zip (23.1 KB)

The sample code as follows:

Workbook wb = new Workbook(filePath + "sample.xlsx");
Chart chart = wb.Worksheets[0].Charts[0];
chart.ChartArea.Area.FillFormat.FillType = FillType.None;
chart.ToImage(filePath + "out_net.svg", ImageType.Svg);
wb.Save(filePath + "out_net.xlsx");

Hope helps a bit.

It works well, thanks very much John!

@marksmancl
Thank you for your feedback. You are welcome. If you have any questions, please feel free to contact us.