There are some issues when converting an excel chart to an image with Aspose Cells.
For the first image, “RB_OPR_G_UEL-Entw_02.png”:
1.Expected:
The green textfield has the text: “Auslastung Aufgreifkriterium”
Actual:
The green textfield has the text “Auslastung”.
This seems to be an overflow issue, for example if we remove the space between the two words, it will generate correctly. If we add another 1 letter word after the combined words, then that letter will not be generated.
2.Expected:
The dates of the labels are in the format “Month/ Year”; example: “Dez/ 17”
Actual:
The dates of the labels are in the format “Month. Year”; example: “Dez. 17”
For the second image, “RB_OPR_G_UEL-Vert_02.png”:
1.Expected:
Only “DDD…” label is present on the Ox axis
Actual:
There are extra labels appearing for the Ox axis like “AAA…”, “BBB…”
2.Expected:
The label “DDD…” is on a single line.
Actual:
The label “DDD…” is wrapping on the second line.
Here is the code reproducing these issues:
Tuple< string, string>[] inputData = {
Tuple.Create( "RB_OPR_G_UEL-Entw_02", "\\RB_OPR_G_UEL-Entw_02.png"),
Tuple.Create( "RB_OPR_G_UEL-Vert_02", "\\RB_OPR_G_UEL-Vert_02.png"),
};
var imageOrPrintOptions = new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.Default,
ChartImageType = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = true
};
foreach (var input in inputData)
{
using (FileStream fs = File.OpenRead(Server.MapPath("/File") + "\\Input.xlsx"))
{
var workbook = new Workbook(fs);
var chart = workbook.Worksheets["OpRisk_UEL Verteilung"].Charts[input.Item1];
var image = chart.ToImage(imageOrPrintOptions);
image.Save(Server.MapPath("/File") + input.Item2, ImageFormat.Png);
};
}
I have also attached the Web App reproducing this issues.
WebApp.zip (99.0 KB)