Exemple #1
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed3DPlotData pdata)
        {
            // first, we have to calculate the span of logical values from the minimum logical value to the maximum logical value
            int numberOfItems = 0;

            if (null != pdata)
            {
                double minLogicalX = double.MaxValue;
                double maxLogicalX = double.MinValue;
                double minLogicalY = double.MaxValue;
                double maxLogicalY = double.MinValue;
                foreach (int originalRowIndex in pdata.RangeList.OriginalRowIndices())
                {
                    numberOfItems++;

                    double logicalX = layer.XAxis.PhysicalVariantToNormal(pdata.GetXPhysical(originalRowIndex));
                    if (logicalX < minLogicalX)
                    {
                        minLogicalX = logicalX;
                    }
                    if (logicalX > maxLogicalX)
                    {
                        maxLogicalX = logicalX;
                    }

                    double logicalY = layer.YAxis.PhysicalVariantToNormal(pdata.GetXPhysical(originalRowIndex));
                    if (logicalY < minLogicalY)
                    {
                        minLogicalY = logicalY;
                    }
                    if (logicalY > maxLogicalY)
                    {
                        maxLogicalY = logicalY;
                    }
                }

                BarSizePosition3DGroupStyle.IntendToApply(externalGroups, localGroups, numberOfItems, minLogicalX, maxLogicalX, minLogicalY, maxLogicalY);
            }
            BarSizePosition3DGroupStyle bwp = PlotGroupStyle.GetStyleToInitialize <BarSizePosition3DGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Initialize(_barShiftStrategy, _barShiftMaxNumberOfItemsInOneDirection, _relInnerGapX, _relOuterGapX, _relInnerGapY, _relOuterGapY);
            }

            if (!_independentColor) // else if is used here because fill color has precedence over frame color
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate()
                                             { return(_pen.Color); });
            }
        }
Exemple #2
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            _cachedColorForIndexFunction = null;

            BarSizePosition3DGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarSizePosition3DGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Apply(
                    out _barShiftStrategy, out _barShiftMaxNumberOfItemsInOneDirection,
                    out _relInnerGapX, out _relOuterGapX, out _xSizeLogical, out _xOffsetLogical,
                    out _relInnerGapY, out _relOuterGapY, out _ySizeLogical, out _yOffsetLogical);
            }

            if (!_independentColor)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _pen = _pen.WithColor(c); });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, System.Drawing.Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }
        }
Exemple #3
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     BarSizePosition3DGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }
Exemple #4
0
 public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
 {
     BarSizePosition3DGroupStyle.AddExternalGroupStyle(externalGroups);
 }