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

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)

I understand the implication of setting the scaling of the image. When I set it to 100, these issues are no longer there. Thanks.

This is looking good. But please take a look at these screenshot:

Screen shot 1:
KeyDrivers_G1_L17.jpg (391.0 KB)
The above screenshot is from Worksheet KeyDrivers and cell address G1:L17.

In this screenshot, the section highlighted in yellow shows the differences in the graphical representation of arrows. The design itself is different in aspose.

The section highlighted purple shows how different the blue bar graphs are in terms of its size. With both scale factor set to 100. Aspose one seems to be quite different in terms of the spacing and dimension.

The section highlighted in red shows the graph text is missing in aspose.

Screenshot 2:
RespTable_K4_P24.jpg (265.6 KB)
Screenshot 2 is from worksheet RespTable cell address K4:P24

In the section highlighted in purple, when you compare where the line breaks/carriage return are after each sentence, you’ll notice that the one in aspose splits the sentence into the next line usually a word off the original one. Look at the Line break/CR at the end of each line in aspose and compare the position of the line break/CR in excel.

@leoluo
Thanks for further details. Let us investigate and analyze your issue in details. Hopefully we could figure it out soon. Once we have an update on it, we will let you know.

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

Hi Aspose team,
Issues CELLSNET-57741 and CELLSNET-57768 can be closed as this was fixed by setting the right resolution as suggested by you.

Regarding issue CELLSNET-57742, are there any updates?
Thanks.

@JThomas98,

The details have been recorded in the corresponding tickets, which we may proceed to close (if feasible).

I am afraid, the issue has not been addressed yet. We will check if we could schedule it in the next few days. Once there is any update or new information on it, we will let you know here.

Thank you! Looking forward to it.

@JThomas98,

You are welcome. We will keep you posted with new updates on it.

I have a few other issues that I’ve run into.

Test_02182025.zip (3.3 MB)

I’ve explained in detail every issue that I ran into in one of my tests along with some screenshots comparing it against excel.

The code I used is:

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

        // Set the print area with your desired range in the worksheet
        worksheet.PageSetup.PrintArea = "B98:M139";
        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.OfficeCompatibleEmf,
            HorizontalResolution = 100,
            VerticalResolution = 100,
            OnlyArea = true
        };
        // Take the image of your worksheet
        SheetRender sr = new SheetRender(worksheet, options);
        sr.ToImage(0, path + "MyOut.jpg");

@JThomas98,

Thanks for the template Excel file and screenshots.

I am able to reproduce all your three issues you mentioned (via screenshots in the document) using your template Excel file and sample code snippet. 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-57839 - Missing labels on bottom and the blue header has vertical lines across it
  • CELLSNET-57840 - Labels moved for small proportions in Pie chart; font type is different in both sets of chart; missing labels on bottom-left bar chart; font kerning is reduced in some chart labels
  • CELLSNET-57841 - Different fonts in charts in Sheet to image conversion

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.

In my documentation, I’ve mentioned how the missing legend issue has come up in the past, CELLSNET-55343 might have been the issue ID. I thought this was resolved a long time ago.

@JThomas98,

We have noted it down. Let us evaluate the issue(s) and then we can update you on the issues. Once we have an update on any of the issues, we will let you know here.

1 Like

@JThomas98 ,

In newer Excel, Excel re-designed the star graphic(Icon Set graphics). We will evaluate to following the new design. If we have any progress, we will update you here.
Screenshot_star_graphic_issue.jpg (264.3 KB)

Thank you. Looking forward to the updates.

@JThomas98,

Sure, we will keep you informed as soon as the latest updates on the issue become available.

@JThomas98,

We are pleased to inform you that your issue (logged earlier as “CELLSNET-57742”) has been resolved. The enhancement will be included in the next release (Aspose.Cells v25.3) scheduled for release first half of March (next month). You will be notified once the new version is published.

Can I see an output of the fix?

@JThomas98,

Sure, we will check if we could provide you the output image generated by the latest fix. We will get back to you soon.