A newer version of this page is available. Switch to the current version.

AxisBase.QualitativeScaleComparer Property

Gets or sets the comparer used to compare deferred-axis qualitative scale values.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v18.2.dll


public IComparer QualitativeScaleComparer { get; set; }
Public Property QualitativeScaleComparer As IComparer

Property Value

Type Description

An object of the class implementing the IComparer interface.


To implement a custom qualitative scale values sort order, assign an object of a class implementing the IComparer interface to the AxisBase.QualitativeScaleComparer property.

using System;
using System.Collections;

namespace QualitativeScaleCustomSortOrderSample {
    class NumberComparer : IComparer {
        public int Compare(object x, object y) {
            int iX = NumberConverter.ToInt(x);
            int iY = NumberConverter.ToInt(y);
            return iX - iY;

    class NumberConverter {
        public static int ToInt(object o) {
            string stringNumber = o as string;
            int number = 0;
            if (stringNumber == null) return -1;
            if (Int32.TryParse(stringNumber, out number))
                return number;
            switch (stringNumber.ToLower()) {
                case "one": return 1;
                case "two": return 2;
                case "three": return 3;
            return number;


See Also