internal SLAreaChartOptions Clone()
        {
            SLAreaChartOptions aco = new SLAreaChartOptions();
            aco.iGapDepth = this.iGapDepth;

            return aco;
        }
        /// <summary>
        /// Clone a new instance of SLAreaChartOptions.
        /// </summary>
        /// <returns>An SLAreaChartOptions object.</returns>
        public SLAreaChartOptions Clone()
        {
            SLAreaChartOptions aco = new SLAreaChartOptions();
            aco.HasDropLines = this.HasDropLines;
            aco.DropLines = this.DropLines.Clone();
            aco.iGapDepth = this.iGapDepth;

            return aco;
        }
Example #3
0
        /// <summary>
        /// Clone a new instance of SLAreaChartOptions.
        /// </summary>
        /// <returns>An SLAreaChartOptions object.</returns>
        public SLAreaChartOptions Clone()
        {
            SLAreaChartOptions aco = new SLAreaChartOptions();

            aco.HasDropLines = this.HasDropLines;
            aco.DropLines    = this.DropLines.Clone();
            aco.iGapDepth    = this.iGapDepth;

            return(aco);
        }
Example #4
0
 internal void MergeOptions(SLAreaChartOptions aco)
 {
     this.HasDropLines = aco.HasDropLines;
     this.DropLines    = aco.DropLines.Clone();
     this.GapDepth     = aco.GapDepth;
 }
 internal void MergeOptions(SLAreaChartOptions aco)
 {
     this.HasDropLines = aco.HasDropLines;
     this.DropLines = aco.DropLines.Clone();
     this.GapDepth = aco.GapDepth;
 }
Example #6
0
 internal void MergeOptions(SLAreaChartOptions aco)
 {
     this.GapDepth = aco.GapDepth;
 }
Example #7
0
        private void PlotDataSeriesAsAreaChart(int DataSeriesIndex, SLChartDataDisplayType DisplayType, SLAreaChartOptions Options, bool IsPrimary)
        {
            // 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;

            // is primary, no primary axes -> set primary axes
            // is primary, has primary axes -> do nothing
            // is secondary, no primary axes -> set primary axes, force as primary
            // is secondary, has primary axes, no secondary axes -> set secondary axes
            // is secondary, has primary axes, has secondary axes -> do nothing

            bool bIsPrimary = IsPrimary;
            if (!this.PlotArea.HasPrimaryAxes)
            {
                // no primary axes in the first place, so force primary axes
                bIsPrimary = true;
                this.PlotArea.HasPrimaryAxes = true;
                this.PlotArea.PrimaryTextAxis.AxisType = SLAxisType.Category;
                this.PlotArea.PrimaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                this.PlotArea.PrimaryValueAxis.AxisPosition = C.AxisPositionValues.Left;

                this.PlotArea.PrimaryTextAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
            }
            else if (!bIsPrimary && this.PlotArea.HasPrimaryAxes && !this.PlotArea.HasSecondaryAxes)
            {
                this.PlotArea.HasSecondaryAxes = true;
                this.PlotArea.SecondaryTextAxis.AxisType = SLAxisType.Category;
                this.PlotArea.SecondaryTextAxis.AxisPosition = this.HasShownSecondaryTextAxis ? C.AxisPositionValues.Top : C.AxisPositionValues.Bottom;
                this.PlotArea.SecondaryValueAxis.AxisPosition = C.AxisPositionValues.Right;

                this.PlotArea.SecondaryTextAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                this.PlotArea.SecondaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
            }

            SLDataSeriesChartType vType = bIsPrimary ? SLDataSeriesChartType.AreaChartPrimary : SLDataSeriesChartType.AreaChartSecondary;
            int iChartType = (int)vType;

            if (this.PlotArea.UsedChartTypes[iChartType])
            {
                // the chart is already used.
                
                if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
            }
            else
            {
                this.PlotArea.UsedChartTypes[iChartType] = true;

                switch (DisplayType)
                {
                    case SLChartDataDisplayType.Normal:
                        this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.Standard;
                        if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                        break;
                    case SLChartDataDisplayType.Stacked:
                        this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.Stacked;
                        if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                        break;
                    case SLChartDataDisplayType.StackedMax:
                        this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.PercentStacked;
                        if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);

                        if (bIsPrimary) this.PlotArea.PrimaryValueAxis.FormatCode = "0%";
                        else this.PlotArea.SecondaryValueAxis.FormatCode = "0%";
                        break;
                }

                this.PlotArea.DataSeries[index].ChartType = vType;
            }
        }
Example #8
0
 /// <summary>
 /// Plot a specific data series as an area chart on the secondary axes. If there are no primary axes, it will be plotted on the primary axes instead. 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="DisplayType">Chart display type. This corresponds to the 3 typical types in most charts: normal (or clustered), stacked and 100% stacked.</param>
 /// <param name="Options">Chart customization options.</param>
 public void PlotDataSeriesAsSecondaryAreaChart(int DataSeriesIndex, SLChartDataDisplayType DisplayType, SLAreaChartOptions Options)
 {
     this.PlotDataSeriesAsAreaChart(DataSeriesIndex, DisplayType, Options, false);
 }
Example #9
0
 /// <summary>
 /// Plot a specific data series as an area chart on the primary axes. 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="DisplayType">Chart display type. This corresponds to the 3 typical types in most charts: normal (or clustered), stacked and 100% stacked.</param>
 /// <param name="Options">Chart customization options.</param>
 public void PlotDataSeriesAsPrimaryAreaChart(int DataSeriesIndex, SLChartDataDisplayType DisplayType, SLAreaChartOptions Options)
 {
     this.PlotDataSeriesAsAreaChart(DataSeriesIndex, DisplayType, Options, true);
 }
Example #10
0
        /// <summary>
        /// Set an area chart using one of the built-in area chart types.
        /// </summary>
        /// <param name="ChartType">A built-in area chart type.</param>
        /// <param name="Options">Chart customization options.</param>
        public void SetChartType(SLAreaChartType ChartType, SLAreaChartOptions Options)
        {
            this.Is3D = SLChartTool.Is3DChart(ChartType);

            SLDataSeriesChartType vType;
            int iChartType;
            switch (ChartType)
            {
                case SLAreaChartType.Area:
                    vType = SLDataSeriesChartType.AreaChartPrimary;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.Standard;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                    break;
                case SLAreaChartType.StackedArea:
                    vType = SLDataSeriesChartType.AreaChartPrimary;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.Stacked;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                    break;
                case SLAreaChartType.StackedAreaMax:
                    vType = SLDataSeriesChartType.AreaChartPrimary;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.PercentStacked;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                    this.PlotArea.PrimaryValueAxis.FormatCode = "0%";
                    break;
                case SLAreaChartType.Area3D:
                    this.RotateX = 15;
                    this.RotateY = 20;
                    this.RightAngleAxes = false;
                    this.Perspective = 30;

                    vType = SLDataSeriesChartType.Area3DChart;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.Standard;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                    this.PlotArea.HasDepthAxis = true;
                    this.PlotArea.DepthAxis.IsCrosses = true;
                    this.PlotArea.DepthAxis.Crosses = C.CrossesValues.AutoZero;
                    break;
                case SLAreaChartType.StackedArea3D:
                    this.RotateX = 15;
                    this.RotateY = 20;
                    this.RightAngleAxes = false;
                    this.Perspective = 30;

                    vType = SLDataSeriesChartType.Area3DChart;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.Stacked;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                    break;
                case SLAreaChartType.StackedAreaMax3D:
                    this.RotateX = 15;
                    this.RotateY = 20;
                    this.RightAngleAxes = false;
                    this.Perspective = 30;

                    vType = SLDataSeriesChartType.Area3DChart;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].Grouping = C.GroupingValues.PercentStacked;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.MidpointCategory;
                    this.PlotArea.PrimaryValueAxis.FormatCode = "0%";
                    break;
            }
        }
Example #11
0
 /// <summary>
 /// Creates an instance of SLAreaChartOptions with theme information.
 /// </summary>
 /// <returns>An SLAreaChartOptions object with theme information.</returns>
 public SLAreaChartOptions CreateAreaChartOptions()
 {
     SLAreaChartOptions aco = new SLAreaChartOptions(this.listThemeColors, this.IsStylish);
     return aco;
 }