We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Surface chart cannot be converted as image

When using the Aspose.Cells ToImage function in order to convert it to an image, it just returns a null.
Expected: the surface chart should be converted to an image

    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 attached the web app that reproduces the issue
WebAppAspose.zip (18.9 KB)

@edis.omer,

Thanks for the sample file and code snippet.

Surface chart is not supported for rendering, see the list/table for supported/not supported charts for your reference:

FYI, we already logged a ticket with an id “CELLSNET-47843” to support Surface chart for rendering to image/PDF format. Once we have an update on it, we will let you know here.