internal static bool Is3DChart(SLColumnChartType ChartType) { var result = false; switch (ChartType) { case SLColumnChartType.ClusteredColumn3D: case SLColumnChartType.ClusteredCone: case SLColumnChartType.ClusteredCylinder: case SLColumnChartType.ClusteredPyramid: case SLColumnChartType.Column3D: case SLColumnChartType.Cone3D: case SLColumnChartType.Cylinder3D: case SLColumnChartType.Pyramid3D: case SLColumnChartType.StackedColumn3D: case SLColumnChartType.StackedColumnMax3D: case SLColumnChartType.StackedCone: case SLColumnChartType.StackedConeMax: case SLColumnChartType.StackedCylinder: case SLColumnChartType.StackedCylinderMax: case SLColumnChartType.StackedPyramid: case SLColumnChartType.StackedPyramidMax: result = true; break; } return(result); }
/// <summary> /// Set a column chart using one of the built-in column chart types. /// </summary> /// <param name="ChartType">A built-in column chart type.</param> /// <param name="Options">Chart customization options.</param> public void SetChartType(SLColumnChartType ChartType, SLBarChartOptions Options) { this.Is3D = SLChartTool.Is3DChart(ChartType); SLDataSeriesChartType vType; int iChartType; switch (ChartType) { case SLColumnChartType.ClusteredColumn: vType = SLDataSeriesChartType.BarChartColumnPrimary; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Clustered; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedColumn: vType = SLDataSeriesChartType.BarChartColumnPrimary; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Stacked; this.PlotArea.UsedChartOptions[iChartType].Overlap = 100; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedColumnMax: vType = SLDataSeriesChartType.BarChartColumnPrimary; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.PercentStacked; this.PlotArea.UsedChartOptions[iChartType].Overlap = 100; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.ClusteredColumn3D: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Clustered; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Box; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedColumn3D: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Stacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Box; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedColumnMax3D: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.PercentStacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Box; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.Column3D: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = false; this.Perspective = 30; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Standard; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Box; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; this.PlotArea.HasDepthAxis = true; break; case SLColumnChartType.ClusteredCylinder: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Clustered; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cylinder; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedCylinder: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Stacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cylinder; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedCylinderMax: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.PercentStacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cylinder; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.Cylinder3D: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = false; this.Perspective = 30; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Standard; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cylinder; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; this.PlotArea.HasDepthAxis = true; break; case SLColumnChartType.ClusteredCone: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Clustered; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cone; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedCone: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Stacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cone; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedConeMax: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.PercentStacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cone; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.Cone3D: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = false; this.Perspective = 30; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Standard; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Cone; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; this.PlotArea.HasDepthAxis = true; break; case SLColumnChartType.ClusteredPyramid: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Clustered; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Pyramid; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedPyramid: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Stacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Pyramid; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.StackedPyramidMax: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = true; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.PercentStacked; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Pyramid; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; break; case SLColumnChartType.Pyramid3D: this.RotateX = 15; this.RotateY = 20; this.RightAngleAxes = false; this.Perspective = 30; vType = SLDataSeriesChartType.Bar3DChart; this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType); iChartType = (int)vType; this.PlotArea.UsedChartTypes[iChartType] = true; this.PlotArea.UsedChartOptions[iChartType].BarDirection = C.BarDirectionValues.Column; this.PlotArea.UsedChartOptions[iChartType].BarGrouping = C.BarGroupingValues.Standard; this.PlotArea.UsedChartOptions[iChartType].Shape = C.ShapeValues.Pyramid; if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options); this.PlotArea.SetDataSeriesChartType(vType); this.PlotArea.HasPrimaryAxes = true; this.PlotArea.HasDepthAxis = true; break; } }
internal static bool Is3DChart(SLColumnChartType ChartType) { bool result = false; switch (ChartType) { case SLColumnChartType.ClusteredColumn3D: case SLColumnChartType.ClusteredCone: case SLColumnChartType.ClusteredCylinder: case SLColumnChartType.ClusteredPyramid: case SLColumnChartType.Column3D: case SLColumnChartType.Cone3D: case SLColumnChartType.Cylinder3D: case SLColumnChartType.Pyramid3D: case SLColumnChartType.StackedColumn3D: case SLColumnChartType.StackedColumnMax3D: case SLColumnChartType.StackedCone: case SLColumnChartType.StackedConeMax: case SLColumnChartType.StackedCylinder: case SLColumnChartType.StackedCylinderMax: case SLColumnChartType.StackedPyramid: case SLColumnChartType.StackedPyramidMax: result = true; break; } return result; }
/// <summary> /// Set a column chart using one of the built-in column chart types. /// </summary> /// <param name="ChartType">A built-in column chart type.</param> public void SetChartType(SLColumnChartType ChartType) { this.SetChartType(ChartType, null); }