Hi Aspose team,
I’m having an issue where the data labels in a chart are way off in position when compared to it excel equivalent.
Code used to generate the output:
using (Workbook TemplateWB = new Workbook(dir + @"\Test_05142025\Chart_Template.xlsm"))
{
Worksheet sourceWS = TemplateWB.Worksheets["DetailCharts"];
//Set print area
sourceWS.PageSetup.PrintArea = $"B1234:M1270";
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);
Render.ToImage(0, dir + @$"\Test_05142025\DetailCharts_B1234_M1270.png");
}
If you look at the png file, comparison1, you’ll notice the two data labels are pushed further out and seems to be overlapping.
In comparison2 , you can see that the data labels are pushed into the chart.
Test_05142025.zip (1.1 MB)