Example #1
0
		/// <summary>
		/// Determine the value for any major tic.
		/// </summary>
		/// <remarks>
		/// This method properly accounts for <see cref="Scale.IsLog"/>, <see cref="Scale.IsText"/>,
		/// and other axis format settings.
		/// </remarks>
		/// <param name="baseVal">
		/// The value of the first major tic (floating point double)
		/// </param>
		/// <param name="tic">
		/// The major tic number (0 = first major tic).  For log scales, this is the actual power of 10.
		/// </param>
		/// <returns>
		/// The specified major tic value (floating point double).
		/// </returns>
		internal override double CalcMajorTicValue(double baseVal, double tic)
		{
			XDate xDate = new XDate(baseVal);

			switch (_majorUnit) {
				case DateUnit.Year:
				default:
					xDate.AddYears(tic*_majorStep);
					break;
				case DateUnit.Month:
					xDate.AddMonths(tic*_majorStep);
					break;
				case DateUnit.Day:
					xDate.AddDays(tic*_majorStep);
					break;
				case DateUnit.Hour:
					xDate.AddHours(tic*_majorStep);
					break;
				case DateUnit.Minute:
					xDate.AddMinutes(tic*_majorStep);
					break;
				case DateUnit.Second:
					xDate.AddSeconds(tic*_majorStep);
					break;
				case DateUnit.Millisecond:
					xDate.AddMilliseconds(tic*_majorStep);
					break;
			}

			return xDate.XLDate;
		}