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
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:
To keep source data formatting, set NumberFormatOptions.IsSourceLinked to
true. In this case, the API uses a cell format set by the CellValue.NumberFormat property in the underlying spreadsheet.To specify a custom format, set the NumberFormatOptions.FormatCode property to a format code string. For example, use the
"$0"format code to display values as currency without decimal places.
The following code snippet formats value axis labels as currency, sets the font color to green, and changes the font size:

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" };
}