Exemplo n.º 1
0
        private string GetRoundedValue(double min, double max, double value)
        {
            double roundedValue = value;
            var    log          = RoundHelper.GetDifferenceLog(min, max);
            string format       = "G3";
            double diff         = Math.Abs(max - min);

            if (1E3 < diff && diff < 1E6)
            {
                format = "F0";
            }
            if (log < 0)
            {
                format = "G" + (-log + 2).ToString();
            }

            return(roundedValue.ToString(format));
        }
        public ITicksInfo <double> GetTicks(Range <double> range, int ticksCount)
        {
            double min = LogByBase(range.Min);
            double max = LogByBase(range.Max);

            double minDown = Math.Floor(min);
            double maxUp   = Math.Ceiling(max);

            double logLength = LogByBase(range.GetLength());

            ticks = CreateTicks(range);

            int log = RoundHelper.GetDifferenceLog(range.Min, range.Max);
            TicksInfo <double> result = new TicksInfo <double> {
                Ticks = ticks, TickSizes = ArrayExtensions.CreateArray(ticks.Length, 1.0), Info = log
            };

            return(result);
        }