コード例 #1
0
        private static void ApplyLayoutRoundingVertical(CombinedSeries series, RangeSeriesRoundLayoutContext roundLayoutContext)
        {
            double         previousStackRight = -1;
            RangeDataPoint firstPoint;

            Dictionary <double, double> normalizedValueToY = new Dictionary <double, double>();

            foreach (CombineGroup group in series.Groups)
            {
                foreach (CombineStack stack in group.Stacks)
                {
                    firstPoint = stack.Points[0] as RangeDataPoint;
                    if (!firstPoint.isEmpty)
                    {
                        roundLayoutContext.SnapPointToGridLine(firstPoint);

                        // Handles visual glitches that might occur between clustered range bars.
                        RangeSeriesRoundLayoutContext.SnapNormalizedValueToPreviousY(firstPoint, normalizedValueToY);

                        SnapLeftToPreviousRight(firstPoint, previousStackRight);
                        previousStackRight = firstPoint.layoutSlot.Right;
                    }
                    else
                    {
                        previousStackRight = -1;
                    }
                }
                previousStackRight = -1;
            }
        }
コード例 #2
0
        internal override void ApplyLayoutRounding()
        {
            RangeSeriesRoundLayoutContext info = new RangeSeriesRoundLayoutContext(this);

            double            gapLength = CategoricalAxisModel.DefaultGapLength;
            ISupportGapLength axisModel = this.firstAxis as ISupportGapLength;

            if (axisModel == null)
            {
                axisModel = this.secondAxis as ISupportGapLength;
            }

            if (axisModel != null)
            {
                gapLength = axisModel.GapLength;
            }

            int count = this.DataPointsInternal.Count;

            AxisPlotDirection           plotDirection      = this.GetTypedValue <AxisPlotDirection>(AxisModel.PlotDirectionPropertyKey, AxisPlotDirection.Vertical);
            Dictionary <double, double> normalizedValueToY = new Dictionary <double, double>();
            Dictionary <double, double> normalizedValueToX = new Dictionary <double, double>();

            foreach (RangeDataPoint point in this.DataPointsInternal)
            {
                if (point.isEmpty)
                {
                    continue;
                }

                info.SnapPointToGridLine(point);

                // Handles specific scenario where range bar items from non-combined series have the same high/low value (floating point number) i.e.
                // the presenters should be rendered on the same horizontal/vertical pixel row/column.
                if (plotDirection == AxisPlotDirection.Vertical)
                {
                    RangeSeriesRoundLayoutContext.SnapNormalizedValueToPreviousY(point, normalizedValueToY);
                }
                else
                {
                    RangeSeriesRoundLayoutContext.SnapNormalizedValueToPreviousX(point, normalizedValueToX);
                }

                if (gapLength == 0 && point.CollectionIndex < count - 1)
                {
                    DataPoint nextPoint = this.DataPointsInternal[point.CollectionIndex + 1];
                    info.SnapToAdjacentPointInHistogramScenario(point, nextPoint);
                }
            }
        }