2D Chart for WinForms | ComponentOne
Chart Area and Plot Area Objects / Axes / Axis Logarithmic Scaling
In This Topic
    Axis Logarithmic Scaling
    In This Topic

    When data is shown with large differences in scale or when data is expected to vary exponentially on the same chart, it is often convenient to use logarithmic scaling on one or more axes. On a logarithmic axis, equal distance along it depicts an equal percentage change. Each axis can be set to scale logarithmically by setting the IsLogarithmic property to True. If logarithmic scaling is used on one or both axes, the chart is called a Log Scale chart.

    With logarithmic scaling, values are physically spaced based upon the logarithm of the value instead of the value itself. This is useful when quantities are charted over a very wide range, and when depiction of geometric and/or exponential relationships is desired.

    Unlike arithmetic charts where changes are measured in terms of direct units, log scale charts show changes in terms of percentage change. For example, in a log scale chart measuring dollars, a change from $1 to $2 is a 100 percent change so the distance on the chart axis from $1 to $2 would be the same from $50 to $100. Whereas in an arithmetic chart, a change from $50 to $100 would make the distance on the axis from $50 to $100 appear much larger on the chart because it is a change of $50 as opposed to just $1.

    Commonly Used Logarithms

    Logarithms can be expressed using any base value, including integers and floating point values. The two most commonly used types of logarithms include:

    Logarithmic Base

    When the IsLogarithmic property is set to true you can specify the value for the logarithmic base using the LogarithmicBase property. The default value is 10. If a natural log scale is desired, set the LogarithmicBase to a value less than or equal to 1. If the value is 1 then the natural logarithm of 1 would be 0, since e0 = 1. A natural logarithm is the logarithm to the base e. Note that Logarithmic scaling does not make mathematical sense when values are less than or equal to zero. Therefore, negative and zero values are not plotted against axes that have the IsLogarithmic property set to true.

    The following image shows how the C1Chart appears when the LogarithmicBase is set to its default value 10, which is the common logarithm:



    Sample Available

    For a complete sample that demonstrates how to use logarithmic scaling on C1Chart, see the sample, LogPlots located on https://developer.mescius.com/forums/winforms-edition.

    See Also