ComponentOne Chart for WPF and Silverlight
Chart for WPF and Silverlight / Chart Features / Axis / Logarithmic Scaling / UnitMajor and Logarithmic Axes
In This Topic
    UnitMajor and Logarithmic Axes
    In This Topic

    For logarithmic axis scaling, MajorUnit is taken as a multiplier of the base value of each cycle that provides a hint as to the annotation spacing within each cycle of the logarithmic base. That is (MajorUnit * base cycle value) is approximately the annotation value increment within each cycle. For integer logarithmic base values, the result is usually exact. For floating point values, annotations are rounded to nice numbers as for linear scaling.

    Detailed Explanation of UnitMajor and Logarithmic Axes

    Often, when logarithmic scales are used, the bounds of a chart axis will span multiple cycles of the logarithmic base. In these cases, the usual linear specification of MajorUnit no longer makes sense, as a value appropriate for a given cycle makes little sense for the previous or next cycles. For the MajorUnit setting to be of value, it must pertain to values relative to each cycle of the logarithmic base.

    If this doesn't make sense to you, think about what single, fixed, incremental value you might use for the following axis:


    Following the above reasoning, for logarithmic axes, the chart assumes that MajorUnit specifies the fraction of the base value for each cycle. Consider the following examples:



    In each case, the base cycle value is 1. For each cycle the next annotation value = previous number + (base value of cycle * MajorUnit). The maximum value of the MajorUnit is the LogarithmicBase. The automatic value of MajorUnit is always the LogBase.

    When all of the annotation values are calculated, a nice rounding algorithm is applied so the numbers are relatively easy to read. The behavior may seem a bit odd, but it is the result of accommodating any logarithmic base while at the same time obtaining numbers for the annotations that are reasonable to read.

    For example, the plots above are log-base 10 values, but there are also natural-logs to consider such as log-base 2, log-base-x, etc.


    See Also