Beispiel #1
0
        /// <summary>
        /// Constructs a series.
        /// </summary>
        /// <param name="series">The series.</param>
        public virtual void ApplyStyleToSeries(IDrawableSeries <TDrawingContext> series)
        {
            SeriesBuilder?.Invoke(series);

            if ((series.SeriesProperties & SeriesProperties.PieSeries) == SeriesProperties.PieSeries)
            {
                PieSeriesBuilder?.Invoke((IPieSeries <TDrawingContext>)series);
            }

            if ((series.SeriesProperties & SeriesProperties.CartesianSeries) == SeriesProperties.CartesianSeries)
            {
                CartesianSeriesBuilder?.Invoke((ICartesianSeries <TDrawingContext>)series);
            }

            if ((series.SeriesProperties & SeriesProperties.Bar) == SeriesProperties.Bar &&
                (series.SeriesProperties & SeriesProperties.Stacked) != SeriesProperties.Stacked)
            {
                var barSeries = (IBarSeries <TDrawingContext>)series;
                BarSeriesBuilder?.Invoke(barSeries);

                if ((series.SeriesProperties & SeriesProperties.VerticalOrientation) == SeriesProperties.VerticalOrientation)
                {
                    ColumnSeriesBuilder?.Invoke(barSeries);
                }

                if ((series.SeriesProperties & SeriesProperties.HorizontalOrientation) == SeriesProperties.HorizontalOrientation)
                {
                    RowSeriesBuilder?.Invoke(barSeries);
                }
            }

            var stackedBarMask = SeriesProperties.Bar | SeriesProperties.Stacked;

            if ((series.SeriesProperties & stackedBarMask) == stackedBarMask)
            {
                var stackedBarSeries = (IStackedBarSeries <TDrawingContext>)series;
                StackedBarSeriesBuilder?.Invoke(stackedBarSeries);

                if ((series.SeriesProperties & SeriesProperties.VerticalOrientation) == SeriesProperties.VerticalOrientation)
                {
                    StackedColumnSeriesBuilder?.Invoke(stackedBarSeries);
                }

                if ((series.SeriesProperties & SeriesProperties.HorizontalOrientation) == SeriesProperties.HorizontalOrientation)
                {
                    StackedRowSeriesBuilder?.Invoke(stackedBarSeries);
                }
            }

            if ((series.SeriesProperties & SeriesProperties.Scatter) == SeriesProperties.Scatter)
            {
                ScatterSeriesBuilder?.Invoke((IScatterSeries <TDrawingContext>)series);
            }

            if ((series.SeriesProperties & SeriesProperties.Line) == SeriesProperties.Line)
            {
                var lineSeries = (ILineSeries <TDrawingContext>)series;
                LineSeriesBuilder?.Invoke(lineSeries);

                if ((series.SeriesProperties & SeriesProperties.Stacked) == SeriesProperties.Stacked)
                {
                    StackedLineSeriesBuilder?.Invoke(lineSeries);
                }
            }
        }