Shapes in charts rendered by aspose cells into image is slightly different from the excel itself

@duojie.yang,
Can you provide a screenshot of the fix if possible?
Thanks.

@JThomas98,

We will check if we could provide you a screenshot/image showing the fixed results for your reference. We may get back to you soon.

@JThomas98
This is the result after repair.
CELLSNET-58169.png (53.8 KB)

This is looking good. Thanks.
Looking forward to the other fixes.

@JThomas98,

Thank you for confirming. We will also address the other issues and update you here as soon as we have new information.

@JThomas98,

We are pleased to inform you that your issue, i.e., CELLSNET-58168 (The shapes that overlap with the x-axis and y-axis are somehow behind the axis) has been resolved. The results of our optimization are as follows. It will be effective in the upcoming release, Aspose.Cells v25.5 which is expected to be published in the second week of May 2025. You will be notified once the new version is released.
CELLSNET-58168-fix.png (14.7 KB)

This is looking good. Thanks!

@JThomas98

Thank you for the confirmation. We will update here when the new version 25.5 is released(mid May).

Hi, I don’t know if this is right but from comparing a few charts in excel and its rendered image, I have a feeling that texts and shapes in the chart are slightly smaller in the image aspose captures.

To test this theory, I’ve super imposed the excel chart over the image aspose has captured and you can see this in the word document called “Word_Template”.

The code I’ve used to create the output is:

Document RepDoc = new Document();
DocumentBuilder Builder = new DocumentBuilder(RepDoc);
using (Workbook TemplateWB = new Workbook(dir + @"\Test_04282025\Excel_Template.xlsm"))
{
    Worksheet sourceWS = TemplateWB.Worksheets["Demographics"];

    //Set print area
    sourceWS.PageSetup.PrintArea = $"AH72:DT123";
    sourceWS.PageSetup.LeftMargin = 0;
    sourceWS.PageSetup.RightMargin = 0;
    sourceWS.PageSetup.TopMargin = 0;
    sourceWS.PageSetup.BottomMargin = 0;
    // Clear any header/footer as they'll be captured when converting the worksheet to image
    sourceWS.PageSetup.ClearHeaderFooter();

    // Set OnePagePerSheet option as true
    ImageOrPrintOptions options = new ImageOrPrintOptions
    {
        OnePagePerSheet = true,
        ImageType = Aspose.Cells.Drawing.ImageType.Emf,
        HorizontalResolution = 100,
        VerticalResolution = 100,
        OnlyArea = true,
        TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias
    };

    // Take the image of your worksheet
    SheetRender Render = new SheetRender(sourceWS, options);
    // Create a stream to save the image in
    MemoryStream ImgStream = new MemoryStream();
    Render.ToImage(0, ImgStream); //Returns an image of the cell range if an accuarate cell range is suppiled
    if (ImgStream != MemoryStream.Null)
    {                    
        // Insert this image into the place of the old shape.
        Shape newOleShape = Builder.InsertImage(ImgStream);
        Aspose.Words.PageSetup PS = Builder.CurrentSection.PageSetup;
        double PageWidth = PS.PageWidth - PS.LeftMargin - PS.RightMargin;
        if (PageWidth < newOleShape.Width)
            {
                  newOleShape.Width = PageWidth;
            }
    }
}
RepDoc.Save(dir + @"\Test_04282025\Word_Template.docx");

Test_04282025.zip (8.9 MB)

@JThomas98

Thank you for the provided code and documents. We will look into it and give feedback when we have some findings.

1 Like

@JThomas98,

Thanks for the template Excel file, screenshot and code snippet.

After initial testing, I am able to reproduce the issue as you mentioned. I found that texts and shapes in the chart are slightly smaller in the image Aspose.Cells captures.

We require thorough evaluation of the issue. I am able to reproduce the issue as the user has mentioned by using his 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-58312

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.

Looking forward to it. Thanks!

@JThomas98,

We have started analyzing the issue. We keep you posted with updates once available on the issue (“CELLSNET-58312”).

1 Like

The issues you have found earlier (filed as CELLSNET-58169,CELLSNET-58168) have been fixed in this update. This message was posted using Bugs notification tool by leoluo

Hi Aspose Team
Any updates on CELLSNET-58312 & CELLSNET-58167? Thanks.

@JThomas98,

We apologize for the inconvenience, but both issues (CELLSNET-58312 and CELLSNET-58167) remain unresolved at this time. We are evaluating them and will update you with the latest information or an estimated timeline (if possible). Thank you for your patience and understanding.

1 Like

Hi @JThomas98
For CELLSNET-58312, the results of our optimization are as follows, and it will take effect in version 25.6.
250524.png (30.9 KB)

For CELLSNET-58167 ( The shapes in the graph plotting seems to lower resolution ), we apologize that we have not resolved it yet.
As shown in the following figure( This is the zoomed effect of the output image of Aspose.Cells), the shape on the right side looks clearer because Excel clearly defines it as a certain shape, so it is directly drawn out. For the shape in the chart on the left side, Excel only provides an imageData of the icon, which needs to be scaled and drawn in the chart. During the scaling process, the resolution is lost. So this issue still needs more research, sorry for that again.
250526.png (25.7 KB)

@leoluo, fix for CELLSNET-58312 is looking good.

And for the issue CELLSNET-58167, I understand the limitation. I’ll just have to wait for either a work around or a fix but thank you for explaining this.

@JThomas98,

Thank you for confirming and accepting the result for “CELLSNET-58312”.

Regarding ticket “CELLSNET-58167”, we will continue working on it and remain hopeful for a resolution. We will keep you updated as soon as there is any progress.

1 Like

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