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

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


  if (chartType == ChartChartTypeEnum.chChartTypePie ||
  chartType == ChartChartTypeEnum.chChartTypePie3D ||
  chartType == ChartChartTypeEnum.chChartTypeDoughnut)
  {
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasPercentage = true;
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasValue = false;
  }
  // ------------------------------------------------------------------------
  // Not so for other chart types where values have more meaning than
  // percentages.
  // ------------------------------------------------------------------------
  else
  {
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasPercentage = false;
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasValue = true;
  }
  
  // ------------------------------------------------------------------------
  // Plug your own visual bells and whistles here
  // ------------------------------------------------------------------------
  oChartSpace.Charts[0].SeriesCollection[0].Caption = String.Empty;
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Name = "verdana";
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Size = 10;
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Bold = true;
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Color = "red";
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Position = ChartDataLabelPositionEnum.chLabelPositionCenter;
  
  if (chartType == ChartChartTypeEnum.chChartTypeBarClustered ||
  chartType == ChartChartTypeEnum.chChartTypeBar3D ||
  chartType == ChartChartTypeEnum.chChartTypeColumnClustered ||
  chartType == ChartChartTypeEnum.chChartTypeColumn3D)
  {
  oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Position = ChartDataLabelPositionEnum.chLabelPositionOutsideEnd;
  }
  
  oChartSpace.Charts[0].SeriesCollection[0].SetData (OWC11.ChartDimensionsEnum.chDimCategories,
  Convert.ToInt32(OWC11.ChartSpecialDataSourcesEnum.chDataLiteral), chartCategoriesStr);

  oChartSpace.Charts[0].SeriesCollection[0].SetData (OWC11.ChartDimensionsEnum.chDimValues,
  Convert.ToInt32(OWC11.ChartSpecialDataSourcesEnum.chDataLiteral), chartValuesStr);

  return oChartSpace;
  }

  #region  属性设置
  public string[] chartCategoriesArrValue
  {
  get
  {
  return chartCategoriesArr;
  }
  set
  {
  chartCategoriesArr = value;
  }
  }

  public string[] chartValuesArrValue
  {
  get
  {
  return chartValuesArr;

 

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

关注我们

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