/// <summary>
        /// Gets the coordinates used to draw ticks and tick labels (numbers or category names).
        /// </summary>
        /// <param name="majorLabelValues">The major label values.</param>
        /// <param name="majorTickValues">The major tick values.</param>
        /// <param name="minorTickValues">The minor tick values.</param>
        public override void GetTickValues(
            out IList <double> majorLabelValues, out IList <double> majorTickValues, out IList <double> minorTickValues)
        {
            var minimum = this.StartAngle / this.Scale;
            var maximum = this.EndAngle / this.Scale;

            minorTickValues  = AxisUtilities.CreateTickValues(minimum, maximum, this.ActualMinorStep);
            majorTickValues  = AxisUtilities.CreateTickValues(minimum, maximum, this.ActualMajorStep);
            majorLabelValues = AxisUtilities.CreateTickValues(this.Minimum, this.Maximum, this.ActualMajorStep);
        }
Exemple #2
0
        /// <summary>
        /// Creates <see cref="DateTime" /> tick values.
        /// </summary>
        /// <param name="min">The min.</param>
        /// <param name="max">The max.</param>
        /// <param name="interval">The interval.</param>
        /// <param name="intervalType">The interval type.</param>
        /// <returns>A list of <see cref="DateTime" /> tick values.</returns>
        private IList <double> CreateDateTimeTickValues(
            double min, double max, double interval, DateTimeIntervalType intervalType)
        {
            // If the step size is more than 7 days (e.g. months or years) we use a specialized tick generation method that adds tick values with uneven spacing...
            if (intervalType > DateTimeIntervalType.Days)
            {
                return(this.CreateDateTickValues(min, max, interval, intervalType));
            }

            // For shorter step sizes we use the method from Axis
            return(AxisUtilities.CreateTickValues(min, max, interval));
        }
        /// <inheritdoc/>
        public override void GetTickValues(out IList <double> majorLabelValues, out IList <double> majorTickValues, out IList <double> minorTickValues)
        {
            var axisRect = new OxyRect(this.ScreenMin, this.ScreenMax);

            var distanceTopLeft     = axisRect.TopLeft.DistanceTo(this.MidPoint);
            var distanceTopRight    = axisRect.TopRight.DistanceTo(this.MidPoint);
            var distanceBottomRight = axisRect.BottomRight.DistanceTo(this.MidPoint);
            var distanceBottomLeft  = axisRect.BottomLeft.DistanceTo(this.MidPoint);

            var maxDistance = Math.Max(distanceTopLeft, distanceTopRight);

            maxDistance = Math.Max(maxDistance, distanceBottomRight);
            maxDistance = Math.Max(maxDistance, distanceBottomLeft);

            var actualMaximum = this.InverseTransform(maxDistance);

            majorTickValues = AxisUtilities.CreateTickValues(this.ActualMinimum, actualMaximum, this.ActualMajorStep);
            minorTickValues = AxisUtilities.CreateTickValues(this.ActualMinimum, actualMaximum, this.ActualMinorStep);
            minorTickValues = AxisUtilities.FilterRedundantMinorTicks(majorTickValues, minorTickValues);

            majorLabelValues = majorTickValues;
        }