internal static bool Is3DChart(SLDoughnutChartType ChartType) { // all doughnut charts are 2D return(false); }
internal static bool Is3DChart(SLDoughnutChartType ChartType) { // all doughnut charts are 2D return false; }
/// <summary> /// Plot a specific data series as a doughnut chart. WARNING: Only weak checks done on whether the resulting combination chart is valid. Use with caution. /// </summary> /// <param name="DataSeriesIndex">Index of the data series. This is 1-based indexing, so it's 1 for the 1st data series, 2 for the 2nd data series and so on.</param> /// <param name="ChartType">A built-in doughnut chart type for this specific data series.</param> /// <param name="Options">Chart customization options.</param> public void PlotDataSeriesAsDoughnutChart(int DataSeriesIndex, SLDoughnutChartType ChartType, SLPieChartOptions Options) { // the original chart is not combinable if (!this.IsCombinable) return; int index = DataSeriesIndex - 1; // out of bounds if (index < 0 || index >= this.PlotArea.DataSeries.Count) return; SLDataSeriesChartType vType = SLDataSeriesChartType.DoughnutChart; int iChartType = (int)vType; if (this.PlotArea.UsedChartTypes[iChartType]) { // the chart is already used. // don't have to do anything if no options passed in. if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); } else { this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].VaryColors = true; this.PlotArea.UsedChartOptions[iChartType].FirstSliceAngle = 0; this.PlotArea.UsedChartOptions[iChartType].HoleSize = 50; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); } this.PlotArea.DataSeries[index].ChartType = vType; switch (ChartType) { case SLDoughnutChartType.Doughnut: this.PlotArea.DataSeries[index].Options.iExplosion = null; break; case SLDoughnutChartType.ExplodedDoughnut: this.PlotArea.DataSeries[index].Options.Explosion = 25; break; } }
/// <summary> /// Plot a specific data series as a doughnut chart. WARNING: Only weak checks done on whether the resulting combination chart is valid. Use with caution. /// </summary> /// <param name="DataSeriesIndex">The index of the data series. This is 1-based indexing, so it's 1 for the 1st data series, 2 for the 2nd data series and so on.</param> /// <param name="ChartType">A built-in doughnut chart type for this specific data series.</param> public void PlotDataSeriesAsDoughnutChart(int DataSeriesIndex, SLDoughnutChartType ChartType) { this.PlotDataSeriesAsDoughnutChart(DataSeriesIndex, ChartType, null); }
/// <summary> /// Set a doughnut chart using one of the built-in doughnut chart types. /// </summary> /// <param name="ChartType">A built-in doughnut chart type.</param> /// <param name="Options">Chart customization options.</param> public void SetChartType(SLDoughnutChartType ChartType, SLPieChartOptions Options) { this.Is3D = SLChartTool.Is3DChart(ChartType); SLDataSeriesChartType vType; int iChartType; switch (ChartType) { case SLDoughnutChartType.Doughnut: vType = SLDataSeriesChartType.DoughnutChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].VaryColors = true; this.PlotArea.UsedChartOptions[iChartType].FirstSliceAngle = 0; this.PlotArea.UsedChartOptions[iChartType].HoleSize = 50; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); break; case SLDoughnutChartType.ExplodedDoughnut: vType = SLDataSeriesChartType.DoughnutChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].VaryColors = true; this.PlotArea.UsedChartOptions[iChartType].FirstSliceAngle = 0; this.PlotArea.UsedChartOptions[iChartType].HoleSize = 50; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); foreach (SLDataSeries ds in this.PlotArea.DataSeries) { ds.Options.Explosion = 25; } break; } }
/// <summary> /// Set a doughnut chart using one of the built-in doughnut chart types. /// </summary> /// <param name="ChartType">A built-in doughnut chart type.</param> public void SetChartType(SLDoughnutChartType ChartType) { this.SetChartType(ChartType, null); }