When using the ToImage function to convert a map chart to an image, the image chart resulted is not a map chart, but a bar chart.
Tuple<string, string> input = Tuple.Create("Chart 1", "\\Chart 1.png");
var imageOrPrintOptions = new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ChartImageType = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = true
};
using (FileStream fs = File.OpenRead(Server.MapPath("/File") + "\\Input.xlsx"))
{
var workbook = new Workbook(fs);
var chart = workbook.Worksheets["Sheet1"].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 issue
WebAppAspose.zip (696.4 KB)