Hello! When using SheetRender to export chart container range as image, some issues take place:
- text below the legend is shrinked/compressed
- legend’s width is increased (more values displayed on one row)
- axis values are out of the cell’s boundaries
Please, check the attached console project and image showing the above issues!
Thank you.
i.e.
- text below the legend is shrinked/compressed
- legend's width is increased (more values displayed on one row)
The third issue you mentioned, I think if we could open the sheet in the Print Preview (in MS Excel), the view is same as the output image, may be you are asking for a bold category axis labels, anyways we need to check it out and we will do.
Sample code:
var workbook = new Workbook(@"E:\test2\TextBoxInExcelchartlegend\TextBoxInExcel\bin\Debug\Legend.xls");
workbook.CalculateFormula();
var imageOptions = new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ImageFormat = ImageFormat.Png,
OnePagePerSheet = true
};
var worksheet = workbook.Worksheets[0];
worksheet.PageSetup.PrintArea = string.Format("a1:p20");
worksheet.PageSetup.TopMargin = 0;
worksheet.PageSetup.LeftMargin = 0;
worksheet.PageSetup.RightMargin = 0;
worksheet.PageSetup.BottomMargin = 0;
var sheetRender = new SheetRender(worksheet, imageOptions);
sheetRender.ToImage(0, @"E:\test2\TextBoxInExcelchartlegend\TextBoxInExcel\bin\Debug\output1.png");
Please try our latest version Aspose.Cells 21.6.0.
If you find any issue, please provide the source Excel file to help us analyze it.