Exemplo n.º 1
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // SkipFrequency should be the same for all sub plot styles
            if (!_independentSkipFreq)
            {
                _skipFreq = 1;
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { _skipFreq = c; });
            }

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

            if (!_independentDashStyle)
            {
                DashPatternGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IDashPattern c)
                                                 { _linePen = LinePen.WithDashPattern(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;
            }
        }
Exemplo n.º 2
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
        {
            if (IsColorProvider)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(Color); });
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            if (!_independentSkipFrequency)
            {
                SkipFrequencyGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                                     { return(_skipFrequency); });
            }

            // IgnoreMissingDataPoints should be the same for all sub plot styles, so there is no "private" property
            IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);
        }
Exemplo n.º 3
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            if (this.IsColorReceiver)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(PlotColor c) { this.Color = c; });
            }

            SymbolShapeStyleGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(ShapeAndStyle c) { this.ShapeAndStyle = c; });


            if (!_independentSymbolSize)
            {
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(float size) { this.SymbolSize = size; });
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c) { this.SkipFrequency = c; });
        }
Exemplo n.º 4
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
        {
            if (!_independentColor)
            {
                Graph.Plot.Groups.ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                                               { return(_strokePen.Color); });
            }

            if (!_independentSkipFrequency)
            {
                SkipFrequencyGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                                     { return(SkipFrequency); });
            }

            // IgnoreMissingDataPoints should be the same for all sub plot styles, so there is no "private" property
            IgnoreMissingDataPointsGroupStyle.PrepareStyle(externalGroups, localGroups, () => _ignoreMissingDataPoints);

            // note: symbol size and barposition are only applied, but not prepared
            // this item can not be used as provider of a symbol size
        }
Exemplo n.º 5
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            if (IsColorReceiver)
            {
                // try to get a constant color ...
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { Color = c; });
                // but if there is a color evaluation function, then use that function with higher priority
                if (!VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                        { _cachedColorForIndexFunction = evalFunc; }))
                {
                    _cachedColorForIndexFunction = null;
                }
            }

            // try to get the symbol size ...
            if (!_independentSymbolSize)
            {
                _cachedSymbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _cachedSymbolSize = size; });
                // but if there is an symbol size evaluation function, then use this with higher priority.
                if (!VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                             { _cachedSymbolSizeForIndexFunction = evalFunc; }))
                {
                    _cachedSymbolSizeForIndexFunction = null;
                }
            }
            else
            {
                _cachedSymbolSize = _symbolSize;
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            if (!_independentSkipFreq)
            {
                _skipFreq = 1;
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { _skipFreq = c; });
            }
        }
Exemplo n.º 6
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed3DPlotData pdata)
        {
            if (IsColorProvider)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(Color); });
            }

            ScatterSymbolGroupStyle.PrepareStyle(externalGroups, localGroups, delegate
                                                 { return(_symbolShape); });

            if (IsSymbolSizeProvider)
            {
                SymbolSizeGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                                  { return(SymbolSize); });
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            if (!_independentSkipFreq)
            {
                SkipFrequencyGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                                     { return(SkipFrequency); });
            }
        }
Exemplo n.º 7
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);
                }
            }
        }
Exemplo n.º 8
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only)
 }