Beispiel #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); });
            }
        }
Beispiel #2
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
        {
            // first, we have to calculate the span of logical values from the minimum logical value to the maximum logical value
            int    numberOfItems = 0;
            double minLogical    = double.MaxValue;
            double maxLogical    = double.MinValue;

            foreach (int originalRowIndex in pdata.RangeList.OriginalRowIndices())
            {
                double logicalX = layer.XAxis.PhysicalVariantToNormal(pdata.GetXPhysical(originalRowIndex));
                numberOfItems++;
                if (logicalX < minLogical)
                {
                    minLogical = logicalX;
                }
                if (logicalX > maxLogical)
                {
                    maxLogical = logicalX;
                }
            }



            BarWidthPositionGroupStyle.IntendToApply(externalGroups, localGroups, numberOfItems, minLogical, maxLogical);
            BarWidthPositionGroupStyle bwp = PlotGroupStyle.GetStyleToInitialize <BarWidthPositionGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Initialize(_relInnerGapWidth, _relOuterGapWidth);
            }

            if (this.IsColorReceiver)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate() { return(PlotColors.Colors.GetPlotColor(this._fillBrush.Color)); });
            }
        }