Skip to main content
All docs
V26.1
  • AxisBase.NumberFormat Property

    Gets or sets number format options for numerical values displayed in axis labels.

    Namespace: DevExpress.Docs.Office

    Assembly: DevExpress.Docs.Core.v26.1.dll

    Declaration

    public NumberFormatOptions NumberFormat { get; set; }

    Property Value

    Type Description
    NumberFormatOptions

    Contains number format options for numerical values displayed in axis labels.

    Remarks

    To format axis labels, initialize the axis NumberFormat property with a NumberFormatOptions object and specify the formatting options:

    The following code snippet formats value axis labels as currency, sets the font color to green, and changes the font size:

    DevExpress Presentation API - Charts - Format Labels

    using DevExpress.Docs.Office;
    using System.Drawing;
    
        ValueAxis? yAxis = chart.ValueAxis;
        if (yAxis != null) {
            //...
            yAxis.LabelTextProperties = new TextProperties { FontSize = 24, Fill = new SolidFill(Color.DarkGreen), Bold = true };
            yAxis.Fill = new SolidFill(Color.Wheat);
            yAxis.NumberFormat = new NumberFormatOptions { FormatCode = "$0" };
        }
    
    See Also