Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Nov 15, 2021 9:05 pm

I use Spire.Office for Java 4.10.5.

I've used getFormat3D() with this code to construct chart (see PJ) :
Code: Select all
s.getFormat().getFormat3D().setBevelTopType(XLSXChartBevelType.SoftRound);
s.getFormat().getFormat3D().setBevelTopWidth(12);
s.getFormat().getFormat3D().setBevelTopHeight(4);


The saveChartAsImage export the chart, but without the 3D format applied...
Attachments
c3b3e5fa-0353-4075-807f-ac624e8d1c52_BAR.zip
(9.43 KiB) Downloaded 182 times

QuentinSup
 
Posts: 46
Joined: Mon Oct 18, 2021 9:18 am

Tue Nov 16, 2021 3:49 am

Hello,

Thanks for your inquiry.
I tested your Excel file and reproduced your issue. I have logged the issue into our bug tracking system with the ticket number SPIREXLS-3538. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Mon Dec 13, 2021 6:46 am

Hello,

Thanks for your patience.
For the issue SPIREXLS-3538, after investigating, we found that the chart in the Excel file you provided is a 2D clustered column chart, but the data series is set in a 3D format, which makes the chart have a 3D effect. At present, our product does not support keeping this format when saving the Chart as a picture.
Therefore, if you want the result file to retain the 3D format, you need to set the Chart type to the corresponding 3D type, for example:
Code: Select all
chart.setChartType(ExcelChartType.Column3D)

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Mon Dec 13, 2021 2:21 pm

Thanks for your reply,

But using ExcelChartType.Column3D is not a good option and the result is worse...

QuentinSup
 
Posts: 46
Joined: Mon Oct 18, 2021 9:18 am

Tue Dec 14, 2021 3:05 am

Hi,

Thank you for your feedback.
Are you using "ExcelChartType. Column3D" to test the previously provided Excel file (c3b3e5fa-0353-4075-807f-ac624e8d1c52_BAR.xlsx)? If it is, I used the following code to do a test, and I attached my result file for your reference. If it is not, please provide the Excel file you used for our investigation, so as to confirm whether we can provide a sample demo that meets your needs. You could attach it here or send it to us via email (support@e-iceblue.com).
Code: Select all
Workbook workbook = new Workbook();
workbook.loadFromFile("c3b3e5fa-0353-4075-807f-ac624e8d1c52_BAR.xlsx");
Chart chart = workbook.getWorksheets().get(0).getCharts().get(0);
chart.setChartType(ExcelChartType.Column3DClustered);
chart.getSeries().get(0).getFormat().getFill().setFillType(ShapeFillType.SolidColor);
chart.getSeries().get(0).getFormat().getFill().setForeColor(new Color(54,124,179));
chart.getSeries().get(0).getDataPoints().getDefaultDataPoint().getDataLabels().hasValue(true);
chart.getSeries().get(1).getFormat().getFill().setForeColor(new Color(110,162,112));
chart.getSeries().get(1).getDataPoints().getDefaultDataPoint().getDataLabels().hasValue(true);
BufferedImage image = chart.saveToImage();
ImageIO.write(image,"PNG",new File("output.png"));

Sincerely,
Annika
E-iceblue support team
Attachments
output.png
output.png (29.08 KiB) Viewed 405 times
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS

cron