@PJS,
It all depends upon the requirements and scenario where image is being generated hence there is no fixed settings for best results. I tried below sample code with few settings and got proper result. Apparently no issue is observed in the created image and output seems fine. Could you please share what issues are you facing while creating image from the chart? Provide details along with the snapshots and also provide us expected output created by Excel for our reference.
Workbook wb = new Workbook(path + "ExcelChartTest.xlsx");
Chart chart = wb.Worksheets[0].Charts[0];
// Converting chart to image
chart.ToImage(path + "outputChartRendering.emf", System.Drawing.Imaging.ImageFormat.Emf);
// Converting chart to Bitmap
System.Drawing.Bitmap bitmap = chart.ToImage();
bitmap.Save(path + "outputChartRendering.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
//------------------------------------------------
//------------------------------------------------
//Rendering Chart To Image With Advanced Options
// Create an instance of ImageOrPrintOptions and set a few properties
ImageOrPrintOptions options = new ImageOrPrintOptions()
{
VerticalResolution = 300,
HorizontalResolution = 300,
SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
PixelFormat = PixelFormat.Format64bppArgb,
};
// Convert chart to image with additional settings
chart.ToImage(path + "outputChartRendering.png", options);
// Converting chart to PDF
chart.ToPdf(path + "outputChartRendering.pdf");