Chart / Charts / Axes / Scales / Scale Types / Ordinal Scale
In This Topic

    Ordinal Scale

    In This Topic

    An ordinal scale is a type of scale that displays data in different categories which may have a specific order but do not quantify the difference between those categories. This scale is commonly used with bar and line charts as well as their stacked variations. The following image shows an ordinal scale:

     Creating an Ordinal Scale

    You create an ordinal scale by creating an instance of the NOrdinalScale class. The following code shows how to create an ordinal scale and assign labels for the first four categories:

    C#
    Copy Code
    NOrdinalScale ordinalScale = new NOrdinalScale();
    
    NList<string> labels = new NList<string>();
    for (int j = 0; j < dataItemsCount; j++)
    {
    labels.Add("Category " + j.ToString());
    }
    ordinalScale.Labels.TextProvider = new NOrdinalScaleLabelTextProvider(new string[] { "Apples", "Oranges", "Bananas", "Pears"});
    m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale = ordinalScale;