Skip to main content

DxChartAxisLabel.Format Property

Specifies the display format for axis labels.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public ChartElementFormat Format { get; set; }

Property Value

Type Description
ChartElementFormat

Lists formats applied to axis and series labels.

Remarks

The following code formats a value axis’s labels:

<DxChartValueAxis>
    <DxChartAxisLabel Format="ChartElementFormat.Decimal()"></DxChartAxisLabel>
</DxChartValueAxis>

Run Demo: Charts - Multiple Axes

You can use the following built-in formats. To be in effect, an applied format should be compatible with the axis type.

Numeric Formats

  • FixedPoint - 100.11 → 100
  • Percent - 0.1 → 10%
  • Decimal - 100.11 → 100
  • Exponential - 1 000 → 1E+3
  • Thousands - 1 000.11 → 1K
  • Millions - 1 000 000.11 → 1M
  • Billions - 1 000 000 000.11 → 1B
  • Trillions - 1 000 000 000 000 → 1T
  • LargeNumber - Uses “Thousands”, “Millions”, “Billions”, or “Trillions” format depending on the actual value.

Currency Formats

  • Currency - “$3.95”

Date-Time Formats

  • LongDate - “Thursday, January 01, 1970”
  • LongTime - “12:00:00 AM”
  • LongDateLongTime - “Thursday, January 01, 1970, 12:00:00 AM”
  • MonthAndDay - “January 01”
  • MonthAndYear - “1970 January”
  • QuarterAndYear - “QI 1970”
  • ShortDate - “1/25/1970”
  • ShortTime - “12:00 AM”
  • ShortDateShortTime - “1/25/1970, 12:00 AM”
  • Millisecond - “010”
  • Second - “00”
  • Minute - “00”
  • Hour - “12”
  • Day - “01”
  • DayOfWeek - “Thursday”
  • Month - “January”
  • Quarter - “QI”
  • Year - “1970”

Custom Format

If you want to apply a custom format to axis labels, use the FromLdmlString method.

In the following code snippet, the formatting pattern is dd M yy, where dd is the day, MMMMM is the first letter of the month, and yy is the last two digits of the year:

<DxChart Data="@forecasts">
    <DxChartArgumentAxis>
        <DxChartAxisLabel Format='ChartElementFormat.FromLdmlString("d MMMMM yy")'></DxChartAxisLabel>
    </DxChartArgumentAxis>
    @* ... *@
</DxChart>

Formatted string

See Also