internal static bool Is3DChart(SLRadarChartType ChartType)
 {
     // all radar charts are 2D
     return(false);
 }
示例#2
0
 internal static bool Is3DChart(SLRadarChartType ChartType)
 {
     // all radar charts are 2D
     return false;
 }
示例#3
0
        private void PlotDataSeriesAsRadarChart(int DataSeriesIndex, SLRadarChartType ChartType, 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.ShowMajorGridlines = true;
                this.PlotArea.PrimaryValueAxis.MajorTickMark = C.TickMarkValues.Cross;

                this.PlotArea.PrimaryTextAxis.CrossBetween = C.CrossBetweenValues.Between;
                this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.Between;
            }
            else if (!bIsPrimary && this.PlotArea.HasPrimaryAxes && !this.PlotArea.HasSecondaryAxes)
            {
                this.PlotArea.HasSecondaryAxes = true;
                this.PlotArea.SecondaryTextAxis.AxisType = SLAxisType.Category;
                this.PlotArea.SecondaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                this.PlotArea.SecondaryValueAxis.AxisPosition = C.AxisPositionValues.Left;
                this.PlotArea.SecondaryTextAxis.ShowMajorGridlines = true;

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

            // secondary radar: cat axis is also bottom, and value axis is also left, like the primary axis.

            SLDataSeriesChartType vType = bIsPrimary ? SLDataSeriesChartType.RadarChartPrimary : SLDataSeriesChartType.RadarChartSecondary;
            int iChartType = (int)vType;

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

                switch (ChartType)
                {
                    case SLRadarChartType.Radar:
                        this.PlotArea.UsedChartOptions[iChartType].RadarStyle = C.RadarStyleValues.Marker;
                        this.PlotArea.DataSeries[index].Options.Marker.Symbol = C.MarkerStyleValues.None;
                        this.PlotArea.DataSeries[index].ChartType = vType;
                        break;
                    case SLRadarChartType.RadarWithMarkers:
                        this.PlotArea.UsedChartOptions[iChartType].RadarStyle = C.RadarStyleValues.Marker;
                        this.PlotArea.DataSeries[index].Options.Marker.vSymbol = null;
                        this.PlotArea.DataSeries[index].ChartType = vType;
                        break;
                    case SLRadarChartType.FilledRadar:
                        this.PlotArea.UsedChartOptions[iChartType].RadarStyle = C.RadarStyleValues.Filled;
                        this.PlotArea.DataSeries[index].Options.Marker.vSymbol = null;
                        this.PlotArea.DataSeries[index].ChartType = vType;
                        break;
                }
            }
        }
示例#4
0
 /// <summary>
 /// Plot a specific data series as a radar 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="ChartType">A built-in radar chart type for this specific data series.</param>
 public void PlotDataSeriesAsSecondaryRadarChart(int DataSeriesIndex, SLRadarChartType ChartType)
 {
     this.PlotDataSeriesAsRadarChart(DataSeriesIndex, ChartType, false);
 }
示例#5
0
 /// <summary>
 /// Plot a specific data series as a radar 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="ChartType">A built-in radar chart type for this specific data series.</param>
 public void PlotDataSeriesAsPrimaryRadarChart(int DataSeriesIndex, SLRadarChartType ChartType)
 {
     this.PlotDataSeriesAsRadarChart(DataSeriesIndex, ChartType, true);
 }
示例#6
0
        /// <summary>
        /// Set a radar chart using one of the built-in radar chart types.
        /// </summary>
        /// <param name="ChartType">A built-in radar chart type.</param>
        public void SetChartType(SLRadarChartType ChartType)
        {
            this.Is3D = SLChartTool.Is3DChart(ChartType);

            SLDataSeriesChartType vType;
            int iChartType;
            switch (ChartType)
            {
                case SLRadarChartType.Radar:
                    vType = SLDataSeriesChartType.RadarChartPrimary;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].RadarStyle = C.RadarStyleValues.Marker;
                    this.PlotArea.SetDataSeriesChartType(vType);

                    foreach (SLDataSeries ds in this.PlotArea.DataSeries)
                    {
                        ds.Options.Marker.Symbol = C.MarkerStyleValues.None;
                    }

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryTextAxis.ShowMajorGridlines = true;
                    this.PlotArea.PrimaryValueAxis.MajorTickMark = C.TickMarkValues.Cross;
                    break;
                case SLRadarChartType.RadarWithMarkers:
                    vType = SLDataSeriesChartType.RadarChartPrimary;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].RadarStyle = C.RadarStyleValues.Marker;
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryTextAxis.ShowMajorGridlines = true;
                    this.PlotArea.PrimaryValueAxis.MajorTickMark = C.TickMarkValues.Cross;
                    break;
                case SLRadarChartType.FilledRadar:
                    vType = SLDataSeriesChartType.RadarChartPrimary;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    this.PlotArea.UsedChartOptions[iChartType].RadarStyle = C.RadarStyleValues.Filled;
                    this.PlotArea.SetDataSeriesChartType(vType);

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryTextAxis.ShowMajorGridlines = true;
                    this.PlotArea.PrimaryValueAxis.MajorTickMark = C.TickMarkValues.Cross;
                    break;
            }
        }