re charting a pie or a variation thereof percentages make a lot // more sense than values... // ------------------------------------------------------------------------
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.chLa 上一页 [1] [2] [3] [4] [5] 下一页 |