示例#1
0
        internal double ProjectSizeToPixels(DataPoint dataPoint, double value)
        {
            BubbleDataPoint bubbleDataPoint = dataPoint as BubbleDataPoint;

            if (!this.BubbleSeries.IsSizeValueUsed || bubbleDataPoint == null || !bubbleDataPoint.IsSizeValueUsed)
            {
                return(dataPoint.MarkerSize);
            }
            if (!this.BubbleSeries.ActualSizeDataRange.HasData)
            {
                return(0.0);
            }
            Range <double> range = new Range <double>(ValueHelper.ToDouble((object)this.BubbleSeries.ActualSizeDataRange.Minimum), ValueHelper.ToDouble((object)this.BubbleSeries.ActualSizeDataRange.Maximum));
            double         num   = this.BubblePixelAreaSizeRange.Maximum;

            if (RangeHelper.Size(range) != 0.0)
            {
                value = Math.Min(Math.Max(value, range.Minimum), range.Maximum);
                num   = RangeHelper.Project(range, value, this.BubblePixelAreaSizeRange);
            }
            if (this.BubbleSeries.BubbleMarkerSizeRangeUnitType == BubbleSizeRangeUnitType.Relative)
            {
                num = 2.0 * Math.Sqrt(num / Math.PI);
            }
            return(num);
        }
示例#2
0
        internal void BoxZoomRatio(ref double ratio, Range <double> view)
        {
            double num1 = 1.0 / RangeHelper.Size(view);
            double num2 = num1 * ratio;

            if (num2 < this.ActualZoomRange.Minimum)
            {
                double minimum = this.ActualZoomRange.Minimum;
                ratio = Math.Min(minimum / num1, 1.0);
            }
            else
            {
                if (num2 <= this.ActualZoomRange.Maximum)
                {
                    return;
                }
                double maximum = this.ActualZoomRange.Maximum;
                ratio = Math.Max(maximum / num1, 1.0);
            }
        }