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... // ------------------------------------------------------------------------ |