正在阅读:asp.net中调用Office来制作3D统计图asp.net中调用Office来制作3D统计图

2004-09-16 10:21 出处:CSDN 作者:derny 责任编辑:linjixiong


  ChartChartTypeEnum.chChartTypeRadarSmoothLine,
  ChartChartTypeEnum.chChartTypeSmoothLine};


  string[] chartTypesCh = new string [] {"垂直柱状统计图","3D垂直柱状统计图","水平柱状统计图","3D水平柱状统计图","区域统计图","3D区域统计图","中空饼图","折线统计图","3D折线统计图","折线带点统计图","饼图","3D饼图","网状统计图","弧线统计图"};


  for(int i=0;i<chartTypes.Length;i++)
  {
  chartMap.Add(chartTypesCh[i],chartTypes[i]);
  }
  }

  public ChartSpaceClass BuildCharts ()
  {
  string chartCategoriesStr = String.Join ("\t", chartCategoriesArr);
  string chartValuesStr = String.Join ("\t", chartValuesArr);

  OWC11.ChartSpaceClass       oChartSpace = new OWC11.ChartSpaceClass ();

  // ------------------------------------------------------------------------
  // Give pie and doughnut charts a legend on the bottom. For the rest of
  // them let the control figure it out on its own.
  // ------------------------------------------------------------------------

  chartType = (ChartChartTypeEnum)chartMap[chartTypeCh];

  if (chartType == ChartChartTypeEnum.chChartTypePie ||
  chartType == ChartChartTypeEnum.chChartTypePie3D ||
  chartType == ChartChartTypeEnum.chChartTypeDoughnut)
  {
  oChartSpace.HasChartSpaceLegend = true;
  oChartSpace.ChartSpaceLegend.Position = ChartLegendPositionEnum.chLegendPositionBottom;
  }

  oChartSpace.Border.Color = "blue";
  oChartSpace.Charts.Add(0);
  oChartSpace.Charts[0].HasTitle = true;
  oChartSpace.Charts[0].Type = chartType;
  oChartSpace.Charts[0].ChartDepth = 125;
  oChartSpace.Charts[0].AspectRatio = 80;
  oChartSpace.Charts[0].Title.Caption = chartTitle;
  oChartSpace.Charts[0].Title.Font.Bold = true;

  oChartSpace.Charts[0].SeriesCollection.Add(0);
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection.Add ();

  // ------------------------------------------------------------------------
  // If you're charting a pie or a variation thereof percentages make a lot
  // more sense than values...
  // ------------------------------------------------------------------------


  

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品