예제 #1
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            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;
                }
            }

            if (!_independentScatterSymbol)
            {
                ScatterSymbolGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IScatterSymbol c)
                                                   { ScatterSymbol = c; });
            }

            // per Default, set the symbol size evaluation function to null
            _cachedSymbolSizeForIndexFunction = null;
            if (!_independentSymbolSize)
            {
                // try to get a constant symbol size ...
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { SymbolSize = 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;
                }
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            if (!_independentSkipFreq)
            {
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { SkipFrequency = c; });
            }

            // 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);
                }
            }
        }
예제 #2
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;
                }
            }

            ScatterSymbolGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IScatterSymbol c)
                                               { Shape = c; });

            // per Default, set the symbol size evaluation function to null
            _cachedSymbolSizeForIndexFunction = null;
            if (!_independentSymbolSize)
            {
                // try to get a constant symbol size ...
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { SymbolSize = 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;
                }
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            if (!_independentSkipFreq)
            {
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { SkipFrequency = c; });
            }
        }