如何用C#在Excel中生成图表?

如何用C#在Excel中生成图表?
exc.Charts.Add(oMissing,oMissing,1,oMissing); 
    exc.ActiveChart.ChartType=Excel.XlChartType.xlColumnClustered;
    exc.ActiveChart.SetSourceData(worksheet.get_Range("A1","B10"),Excel.XlRowCol.xlColumns);
    exc.ActiveChart.Location(Excel.XlChartLocation.xlLocationAsObject,"sheet1");
    exc.ActiveChart.HasTitle=true;
    exc.ActiveChart.ChartTitle.Text="图表名称";
    exc.ActiveChart.HasDataTable=false;

posted @ 2010-11-18 13:01  落冰  阅读(565)  评论(0编辑  收藏  举报