示例#1
0
            public override Scale Create(DataValueType valueType)
            {
                NumericScale numericScale = new NumericScale();

                numericScale.ValueType = valueType;
                return((Scale)numericScale);
            }
示例#2
0
        private void UpdateActualDisplayUnit()
        {
            NumericScale numericScale = this.Scale as NumericScale;

            if (numericScale != null && numericScale.DisplayUnitSystem != null)
            {
                this.ActualDisplayUnitTitle = (object)numericScale.DisplayUnitSystem.ActualTitle;
            }
            else
            {
                this.ActualDisplayUnitTitle = (object)null;
            }
        }
        private double TransformYValueInScaleUnits(XYDataPoint dataPoint, double yValueInScaleUnits)
        {
            if (!this.IsHundredPercent(dataPoint))
            {
                return(yValueInScaleUnits);
            }
            Range <IComparable> pointYvalueRange = this.GetDataPointYValueRange(dataPoint);
            double       val2         = (double)ValueHelper.ConvertValue((object)pointYvalueRange.Minimum, DataValueType.Float);
            double       num          = Math.Max(0.0, (double)ValueHelper.ConvertValue((object)pointYvalueRange.Maximum, DataValueType.Float)) - Math.Min(0.0, val2);
            NumericScale numericScale = this.Series.YAxis.Scale as NumericScale;

            if (num == 0.0)
            {
                return(this.Series.YAxis.Scale.ProjectDataValue(this.Series.YAxis.Scale.ActualCrossingPosition));
            }
            Range <double> fromRange   = new Range <double>(numericScale.Project(0.0), numericScale.Project(num));
            Range <double> targetRange = new Range <double>(numericScale.Project(0.0), numericScale.Project(1.0));

            return(RangeHelper.Project(fromRange, yValueInScaleUnits, targetRange));
        }