示例#1
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     DashPatternGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     IgnoreMissingDataPointsGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     LineConnection2DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }
示例#2
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            // LineConnectionStyle is the same for all sub plot styles
            LineConnection2DGroupStyle.ApplyStyle(externalGroups, localGroups, (lineConnection, connectCircular) => { _connectionStyle = lineConnection; _connectCircular = connectCircular; });

            if (ColorLinkage.Independent != _fillColorLinkage)
            {
                if (null == _fillBrush)
                {
                    _fillBrush = new BrushX(NamedColors.Black);
                }

                if (_fillColorLinkage == ColorLinkage.Dependent)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _fillBrush.Color = c; });
                }
                else if (ColorLinkage.PreserveAlpha == _fillColorLinkage)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _fillBrush.Color = c.NewWithAlphaValue(_fillBrush.Color.Color.A); });
                }
            }
            if (ColorLinkage.Independent != _frameColorLinkage)
            {
                if (null == _framePen)
                {
                    ChildSetMember(ref _framePen, new PenX(NamedColors.Black));
                }

                if (_frameColorLinkage == ColorLinkage.Dependent)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _framePen.Color = c; });
                }
                else if (ColorLinkage.PreserveAlpha == _fillColorLinkage)
                {
                    ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                               { _framePen.Color = c.NewWithAlphaValue(_framePen.Color.Color.A); });
                }
            }

            // Shift the items ?
            _cachedLogicalShiftX = 0;
            _cachedLogicalShiftY = 0;
            if (!_independentOnShiftingGroupStyles)
            {
                var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface <IShiftLogicalXYGroupStyle>(externalGroups, localGroups);
                if (null != shiftStyle)
                {
                    shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY);
                }
            }
        }
示例#3
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
        {
            if (_fillColorLinkage == ColorLinkage.Dependent && _fillBrush != null)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(_fillBrush.Color); });
            }
            else if (_frameColorLinkage == ColorLinkage.Dependent && _framePen != null)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(_framePen.Color); });
            }

            IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);
            LineConnection2DGroupStyle.PrepareStyle(externalGroups, localGroups, () => new Tuple <ILineConnectionStyle, bool>(_connectionStyle, _connectCircular));
        }
示例#4
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
        {
            if (IsColorProvider)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(Color); });
            }

            if (!_independentDashStyle)
            {
                DashPatternGroupStyle.PrepareStyle(externalGroups, localGroups, delegate
                                                   { return(LinePen.DashPattern); });
            }

            IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);
            LineConnection2DGroupStyle.PrepareStyle(externalGroups, localGroups, () => new Tuple <ILineConnectionStyle, bool>(_connectionStyle, _connectCircular));
        }
示例#5
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            // LineConnectionStyle is the same for all sub plot styles
            LineConnection2DGroupStyle.ApplyStyle(externalGroups, localGroups, (lineConnection, connectCircular) => { _connectionStyle = lineConnection; _connectCircular = connectCircular; });

            // SkipFrequency should be the same for all sub plot styles
            if (!_independentSkipFrequency)
            {
                _skipFrequency = 1;
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { _skipFrequency = c; });
            }

            if (IsColorReceiver)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { Color = c; });
            }

            if (!_independentDashStyle)
            {
                DashPatternGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IDashPattern c)
                                                 { _linePen.DashPattern = c; });
            }

            if (!_independentSymbolSize)
            {
                _symbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _symbolSize = size; });
            }

            // symbol size
            if (!_independentSymbolSize)
            {
                _symbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _symbolSize = size; });

                // but if there is an symbol size evaluation function, then use this with higher priority.
                _cachedSymbolSizeForIndexFunction = null;
                VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                        { _cachedSymbolSizeForIndexFunction = evalFunc; });
            }
            else
            {
                _cachedSymbolSizeForIndexFunction = null;
            }

            // Shift the items ?
            _cachedLogicalShiftX = 0;
            _cachedLogicalShiftY = 0;
            if (!_independentOnShiftingGroupStyles)
            {
                var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface <IShiftLogicalXYGroupStyle>(externalGroups, localGroups);
                if (null != shiftStyle)
                {
                    shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY);
                }
            }
        }