语法 expression.ChartWizard(Source, Gallery, Format, PlotBy, CategoryLabels, SeriesLabels, HasLegend, Title, CategoryTitle, ValueTitle, ExtraTitle) 如果直接把图表类型放入上面函数中Gallery处,则它只支持收下类型 xlArea xlBar xlColumn xlLine xlPie xlRadar xlXYScatter xlCombination xl3DArea xl3DBar xl3DColumn xl3DLine xl3DPie xl3DSurface xlDoughnut xlDefaultAutoFormat 现在可以先在函数中使用以上任为类型图表作为函数把图表添加进去,再给设置图表对象的ChartType属性就可以了 expression.ChartType=[你想要的类型] 例: Microsoft.Office.Interop.Excel.ChartObjects chartObjs = (Microsoft.Office.Interop.Excel.ChartObjects)xlSheet.ChartObjects(Missing.Value); Microsoft.Office.Interop.Excel.ChartObject chartObj = chartObjs.Add(0, 0, 480, 360); Microsoft.Office.Interop.Excel.Chart xlChart = chartObj.Chart; Microsoft.Office.Interop.Excel.Range chartRage = xlSheet.get_Range("A2", "C5"); xlChart.ChartWizard(chartRage, Microsoft.Office.Interop.Excel.XlChartType.xlLine, Missing.Value, Microsoft.Office.Interop.Excel.XlRowCol.xlColumns, 1, 1, true, Missing.Value, Missing.Value, Missing.Value, Missing.Value); xlChart.ChartType = Microsoft.Office.Interop.Excel.XlChartType.xlColumnClustered;