答案 0 :(得分:1)
通过使用SetSize
方法。请注意,有2个重载,一个重载占%,另一个重载像素大小。
using (var ep = new ExcelPackage(file))
{
var ws = ep.Workbook.Worksheets[1];
var chart = ws.Drawings[0];
//Or, to create a new one:
//var chart = ws.Drawings.AddChart("mychart", OfficeOpenXml.Drawing.Chart.eChartType.XYScatter);
//Set the size in pixels:
chart.SetSize(200, 300);
ep.SaveAs(file2);
}