4,819
社区成员
发帖
与我相关
我的任务
分享
.......以上省略
string strSeriesName = "图例 1";
string strCategory = "1" + "\t" + "2" + '\t' + "3" + '\t'+"4" + '\t' + "5" + '\t' + "6" + '\t';
string strValue = "9" + "\t" + "8" + '\t' + "4" + '\t'+"10" + '\t' + "12" + '\t' + "6" + '\t';
//添加一个series
objChart.SeriesCollection.Add(0);
//给定series的名字
objChart.SeriesCollection[0].SetData (Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimSeriesNames,
+ (int)Microsoft.Office.Interop.Owc11.ChartSpecialDataSourcesEnum.chDataLiteral, strSeriesName);
//给定分类
objChart.SeriesCollection[0].SetData (Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimCategories,
+ (int)Microsoft.Office.Interop.Owc11.ChartSpecialDataSourcesEnum.chDataLiteral, strCategory);
//给定值
objChart.SeriesCollection[0].SetData
(Microsoft.Office.Interop.Owc11.ChartDimensionsEnum.chDimValues,
(int)Microsoft.Office.Interop.Owc11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue);
//输出成GIF文件.
string strAbsolutePath = (Server.MapPath(".")) + "\\test.gif";
objCSpace.ExportPicture(strAbsolutePath, "GIF", 600, 350);
......以下省略