Пример #1
0
        /// <summary>
        /// Calculates the visible range.
        /// </summary>
        /// <param name="axis">The axis.</param>
        /// <param name="avalableSize">Size of the available.</param>
        /// <param name="interval">The interval.</param>
        internal static void CalculateVisibleRange(ChartAxisBase2D axis, Size avalableSize, object interval)
        {
            if (axis.ZoomFactor < 1 || axis.ZoomPosition > 0)
            {
#if NETFX_CORE
                if (interval == null || Convert.ToDouble(interval) == 0)
#else
                if (interval == null || ((double?)interval).Value == 0)
#endif
                {
                    axis.VisibleInterval = axis.CalculateNiceInterval(axis.VisibleRange, avalableSize);
                }
                else if (interval != null)
                {
#if NETFX_CORE
                    double actualInterval = Convert.ToDouble(interval);
#else
                    double actualInterval = ((double?)interval).Value;
#endif
                    axis.VisibleInterval = axis.EnableAutoIntervalOnZooming
                                          ? axis.CalculateNiceInterval(axis.VisibleRange, avalableSize)
                                          : actualInterval;
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Calculates the visible range.
 /// </summary>
 /// <param name="axis">The axis.</param>
 /// <param name="availableSize">Size of the available.</param>
 /// <param name="interval">The interval.</param>
 internal static void CalculateVisibleRange(ChartAxisBase2D axis, Size availableSize, double interval)
 {
     if (axis.ZoomFactor < 1 || axis.ZoomPosition > 0)
     {
         if (interval != 0 || !double.IsNaN(interval))
         {
             axis.VisibleInterval = axis.EnableAutoIntervalOnZooming
                                     ? axis.CalculateNiceInterval(axis.VisibleRange, availableSize)
                                     : axis.ActualInterval;
         }
         else
         {
             axis.VisibleInterval = axis.CalculateNiceInterval(axis.VisibleRange, availableSize);
         }
     }
     else
     {
         var dateTimeAxis = axis as DateTimeAxis;
         if (dateTimeAxis.IntervalType != DateTimeIntervalType.Auto)
         {
             dateTimeAxis.ActualIntervalType = dateTimeAxis.IntervalType;
         }
         if (interval != 0 || !double.IsNaN(interval))
         {
             axis.VisibleInterval = axis.ActualInterval;
         }
         else
         {
             axis.VisibleInterval = axis.CalculateNiceInterval(axis.VisibleRange, availableSize);
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Calculates the visible range.
 /// </summary>
 /// <param name="axis">The axis.</param>
 /// <param name="avalableSize">Size of the available.</param>
 /// <param name="interval">The interval.</param>
 internal static void CalculateVisibleRange(ChartAxisBase2D axis, Size avalableSize, object interval)
 {
     if (axis.ZoomFactor < 1 || axis.ZoomPosition > 0)
     {
         if (interval != null)
         {
             axis.VisibleInterval = axis.EnableAutoIntervalOnZooming
                                     ? axis.CalculateNiceInterval(axis.VisibleRange, avalableSize)
                                     : axis.ActualInterval;
         }
         else
         {
             axis.VisibleInterval = axis.CalculateNiceInterval(axis.VisibleRange, avalableSize);
         }
     }
 }