The image Aspose.Cell captures does not look like the original excel chart

@JThomas98 ,

The smaller font issue highlight in your screenshot “Comparison.jpg” is improved after enabling OnlyArea option. Please hightlight this issue where font size is obviously small after OnlyArea is enabled.

Sorry for the late reply. I’ve done some testing on my end with only area property set to true. The font resizing is not as significant as I’ve seen with the property disabled. So thank you for guiding me to the correct set of properties that matches my requirement. The fact that this property adds an extra page is beyond my understanding. But I’ve managed to find a workaround by removing any blank pages from the output. I’m looking forward to the new version that contains the fix for issue #56511. Thank you again for your help.

@JThomas98,

I am glad to hear that the font resizing issue has been resolved on your end. The upcoming release of Aspose.Cells for .NET v24.9, which includes a fix for “CELLSNET-56511”, is expected to be published in the next week.

The issues you have found earlier (filed as CELLSNET-56511) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Hey Aspose Team,
I’m still having some issues with the way some of the charts look when converted to an image using aspose compared to what it looks like in excel.
I’ve attached a document called differences which list out the issues I have. I’ve also attached a template for you to use for testing.
Test.zip (1.7 MB)

@JThomas98
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.

CELLSNET-57742: icon set is not same as MS Excel
CELLSNET-57741: Invalid color of category axis

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.

Thanks. I found another issue as well.
The background pattern in a few charts are missing in the aspose output.
I’ve attached a comparison document
Differences.zip (180.7 KB)

I think you’ve missed one issue I’ve mentioned. Issue #3 - Label wrapping into another line. Please let me know if you’ve noticed this. Thanks.

@JThomas98,

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-57768

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.

@JThomas98,

Given that the thread is getting lengthy, certain part/portion might be overlooked. Could you please provide a more detailed explanation along with a sample Excel file, output image/PDF, and screenshots to demonstrate the issue and emphasize the differences? We will also check it.

Sure, here you go:
Test.zip (1.3 MB)

@JThomas98,

Thanks for the template Excel file and differences document.

Which version of the API you are using? I tested your scenario/case using Aspose.Cells 25.1.x to convert the table range in the specified sheet to image, it works fine and the output image is OK without labels being wrapped. I used the following sample code with your template Excel file.
e.g.,
Sample code:

//Load the Excel file
Workbook workbook = new Workbook("e:\\test2\\Template_Stnd_Type1.xlsm");

// Access the worksheet
Worksheet worksheet = workbook.Worksheets["KeyDrivers"];

// Set the print area with your desired range in the worksheet
worksheet.PageSetup.PrintArea = "G3:L17";

// Set OnePagePerSheet option as true
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.OnePagePerSheet = true;
options.ImageType = ImageType.Jpeg;
// Take the image of your worksheet
SheetRender sr = new SheetRender(worksheet, options);
string dataDir = "e:\\test2\\out_image1.jpg";
sr.ToImage(0, dataDir);

Please find attached the output image for your reference.
out_image1.jpg (156.6 KB)

I’m using version 25.1.2 of Aspose Cells

Here’s the code I used.

//Load the Excel file
Workbook workbook = new Workbook(@“C:\Aspose Test\Test\Template_Stnd_Type1.xlsm”);
// Access the worksheet
Worksheet worksheet = workbook.Worksheets[“KeyDrivers”];

        // Set the print area with your desired range in the worksheet
        worksheet.PageSetup.PrintArea = "G2:L17";
        worksheet.PageSetup.LeftMargin = 0;
        worksheet.PageSetup.RightMargin = 0;
        worksheet.PageSetup.TopMargin = 0;
        worksheet.PageSetup.BottomMargin = 0;
        // Clear any header/footer as they'll be captured when converting the worksheet to image
        worksheet.PageSetup.ClearHeaderFooter();

        // Set OnePagePerSheet option as true
        ImageOrPrintOptions options = new ImageOrPrintOptions()
        {
            OnePagePerSheet = true,
            ImageType = Aspose.Cells.Drawing.ImageType.Jpeg,
            HorizontalResolution = 300,
            VerticalResolution = 300,
            OnlyArea = true
        };
        // Take the image of your worksheet
        SheetRender sr = new SheetRender(worksheet, options);
        string dataDir = @"C:\Aspose Test\Test\out_image1.jpg";
        sr.ToImage(0, dataDir);

Test.zip (2.5 MB)

@JThomas98
By testing with sample files and code on the latest version v25.1, we can reproduce the issue. Data label has line break error 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-57769

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 @JThomas98
I opened the file “Template_Stnd_Type1.xlsm” and found charts looks like this:
250207.png (61.7 KB)

The lines seem to be different from the picture you have in your Word document, can you confirm this, thank you. I found this chart in the “Demographics” page.

What I mean is, the dotted lines I see in your xlsm file are made up of continuous dots. And in your word document, the picture I see, the dotted lines are made up of dots and lines. This template doesn’t seem to match your screenshot.

You are right. In the screenshot I shared, it appears as dashes and dots. This is because of the zoom level and it being a screenshot. When i zoom in enough, it comes in as dot. This is what it looks like when I zoom in and capture a screenshot:
Screenshot 2025-02-07 120606.png (17.0 KB)

@JThomas98,

Thank you for sharing the screenshot and relevant details. We will investigate the issue and respond with updates soon.

Hi @JThomas98
Thank you for your reply. I would like to confirm the following issues with you:
1, For CELLSNET-57741, about the dotted line in the chart, after you set the zoom, is the rendered picture actually consistent with Excel and there is no problem anymore?
2, For CELLSNET-57768, about the background pattern in chart, it should also be related to the resolution. Please try the following code:

        Workbook workbook = new Workbook(path + "Template_Stnd_Type1.xlsm");
        // Access the worksheet
        Worksheet worksheet = workbook.Worksheets["DetailCharts"];

        // Set the print area with your desired range in the worksheet
        worksheet.PageSetup.PrintArea = "B73:M107";
        worksheet.PageSetup.LeftMargin = 0;
        worksheet.PageSetup.RightMargin = 0;
        worksheet.PageSetup.TopMargin = 0;
        worksheet.PageSetup.BottomMargin = 0;
        // Clear any header/footer as they'll be captured when converting the worksheet to image
        worksheet.PageSetup.ClearHeaderFooter();

        // Set OnePagePerSheet option as true
        ImageOrPrintOptions options = new ImageOrPrintOptions()
        {
            OnePagePerSheet = true,
            ImageType = Aspose.Cells.Drawing.ImageType.Jpeg,
            HorizontalResolution = 100,
            VerticalResolution = 100,
            OnlyArea = true
        };
        // Take the image of your worksheet
        SheetRender sr = new SheetRender(worksheet, options);
        sr.ToImage(0, path + "MyOut.jpg");

You will clearly see the background lines in the output picture.
If you change the resolution, for example, scale by 5 times:

        HorizontalResolution = 500,
        VerticalResolution = 500,

It will present the effect of your screenshot. But if you zoom in the picture, you can see that there are actually background lines (See attachment). In fact, if you zoom in 5 times in Excel, you will also see the same situation.
So, this should be the different effects of the background pattern after the resolution change, please confirm. Thank you.
compare.zip (1.2 MB)

And for CELLSNET57769 ( Data label has line break error), our optimized results are as follows, which will take effect in version 25.2.
CELLSNET57769_250208.jpg (163.0 KB)