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; |