Skip to main content

DxChartSeriesLabel.ArgumentFormat Property

Specifies the display format for series label arguments.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

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

Property Value

Type Description
ChartElementFormat

The format identificator.

Remarks

You can use built-in formats to customize argument values in series labels. Refer to the following section for a list of available formats: Value Formats.

Series labels do not show arguments by default. You can use {argumentText} and {valueText} placeholders to pass formatted values to the DxChartSeriesLabel.FormatPattern property. Refer to the following topic for more information about series labels: Labels in Blazor Charts.

The following example applies formats to arguments and values, and then uses resulting values to form text in series labels:

formatted text labels

@page "/"

<DxChart Data="@dataPoints"
         Width=600 Height=360>
    <DxChartScatterSeries ArgumentField="@((DataPoint i) => i.Arg)"
                          ValueField="@((DataPoint i) => i.Value1)"
                          Name="Series 1">
        <DxChartSeriesPoint Size=20 />
        <DxChartSeriesLabel ValueFormat=ChartElementFormat.FixedPoint(2) 
                            ArgumentFormat=ChartElementFormat.MonthAndDay
                            FormatPattern="{argumentText}: {valueText}"
                            Visible="true"/>
    </DxChartScatterSeries>
    <DxChartLegend Position=RelativePosition.Outside />
</DxChart>

@code {
    private DataPoint[] dataPoints;
    protected override void OnInitialized() {
        dataPoints = GetDataPoints();
    }
    public class DataPoint {
        public DateTime Arg { get; set; }
        public double Value1 { get; set; }
    }
    public DataPoint[] GetDataPoints() {
        DataPoint[] dataPoints = new DataPoint[] {
            new DataPoint() { Arg = new DateTime(2021, 1, 1), Value1 = 26.54561 },
            new DataPoint() { Arg = new DateTime(2021, 1, 2), Value1 = 24.4521 },
            new DataPoint() { Arg = new DateTime(2021, 1, 3), Value1 = 25.3645 },
            new DataPoint() { Arg = new DateTime(2021, 1, 4), Value1 = 27.4874 },
            new DataPoint() { Arg = new DateTime(2021, 1, 5), Value1 = 28.9654 },
        };
        return dataPoints;
    }
}
See Also