DxChartSeriesLabel.ArgumentFormat Property
Specifies the display format for series label values.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v23.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public ChartElementFormat ArgumentFormat { get; set; }
Property Value
Type | Description |
---|---|
ChartElementFormat | A value that identifies the specified format. |
Remarks
Use the {argumentText} placeholder in the DxChartSeriesLabel.FormatPattern to display arguments formatted by the ArgumentFormat
.
The following example applies ArgumentFormat
and DxChartSeriesLabel.ValueFormat to point arguments and values, and then uses resulting values to form text in series 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