How to convert a 3D chart into a 3D effect image using cells?

I developed a pie chart with a 3D effect, but when I converted the chart to an image, the expected effect was not visible. For your reference I added code along with output.

PieChart.zip (57.1 KB)

@sanjeevkumar.v

To convert a 3D chart into a 3D image using Aspose.Cells, it’s important to ensure that the chart is rendered correctly, especially when dealing with 3D effects. Here are some key points to consider:

  1. Color Depth: The color depth setting can significantly affect how the 3D chart is rendered. It is recommended to use ColorDepth.Format24bpp or ColorDepth.Default to achieve better visual results. Using a lower color depth, such as ColorDepth.Format8bpp, may lead to issues like a white highlight effect in the center of the chart, which can detract from the 3D appearance.

  2. Chart Depth: The depth of the chart itself can impact the visibility of the 3D effect. If the depth is too small, the 3D representation may not be very pronounced. Adjusting the chart’s depth can help enhance the 3D effect. However, note that Aspose.Cells does not currently support real 3D engine effects; the 3D appearance is simulated on a 2D image.

  3. Rendering the Chart: When converting the chart to an image, ensure that you are using the appropriate methods provided by Aspose.Cells. Here is a sample code snippet to convert a 3D chart to an image:

    // Load the workbook
    Workbook workbook = new Workbook("path/to/your/excel/file.xlsx");
    
    // Access the first worksheet
    Worksheet worksheet = workbook.Worksheets[0];
    
    // Access the chart
    Chart chart = worksheet.Charts[0]; // Assuming the first chart is a 3D chart
    
    // Set the image options
    ImageOrPrintOptions options = new ImageOrPrintOptions();
    options.ImageFormat = ImageFormat.Png; // Set the desired image format
    options.HorizontalResolution = 300; // Set resolution
    options.VerticalResolution = 300;
    
    // Convert the chart to an image
    chart.ToImage("path/to/save/image.png", options);
    
  4. Updates and Optimizations: If you are experiencing issues with the rendering of 3D charts, consider updating to the latest version of Aspose.Cells, as optimizations and bug fixes are regularly released.

By following these guidelines, you should be able to convert your 3D pie chart into a 3D image effectively. If you continue to face issues, it may be beneficial to check for updates or optimizations in the library.

Sources:
[1]: Its an excel with 3D chart which does not show Legends correctly and 3D Represnetation is off

@sanjeevkumar.v
By testing with sample code on the latest version v25.1, we can reproduce the issue. Discovered loss of 3D effect when converting chart to image.

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): CELLSNET-57705

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.

@John.He

Okay.

@sanjeevkumar.v
Thank you for your feedback. Once there is an update, we will notify you promptly.

I shared new ticket link: Convert a 3D chart into a 3D image using cells?
I think you can easy find out using above link.

@sanjeevkumar.v
Thank you for your feedback. The issue ticket and forum link are related, and we can easily find the post.