Skip to main content
All docs
V25.1
  • DxRangeSelectorChartValueAxis.ValueType Property

    Specifies the data type of the value axis. Casts values from the assigned data source to the target type if required.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [Parameter]
    public ChartAxisDataType ValueType { get; set; }

    Property Value

    Type Description
    ChartAxisDataType

    An enumeration value.

    Available values:

    Name Description
    Auto

    Does not cast arguments/values and displays them on the axis of the applicable type (Continuous for integer and float data types and Discrete for other data types).

    Numeric

    Casts arguments/values to a numeric type and displays them on the Continuous axis. To parse strings successfully, the decimal separator should be ‘.’.

    String

    Casts arguments/values to the String type and displays them on the Discrete axis.

    DateTime

    Casts arguments/values to the DateTime type and displays them on the Continuous axis. To parse strings successfully, the value should match the ISO JavaScript Date pattern.

    Remarks

    The DxRangeSelectorChart component determines the type of axis values based on the value type specified in the corresponding data source field of a series. For instance, if a data source stores data points as numeric values, axis values are also numeric.

    You may need to change the type of values specified in the data source, for instance, when the assigned data source stores dates or numbers as strings. Use the ValueType property to specify the desired type for axis values. Additionally, you can use the Type property to specify the axis type.

    The following code snippet casts values specified as strings to the Numeric type:

    <DxRangeSelector Width="700px"
                     Height="300px"
                     Data="@Data">
        <DxTitleSettings Text="Population by Country, 2023" />
        <DxRangeSelectorChart>
            <DxChartBarSeries ArgumentField="@((PopulationPoint s) => s.Country)"
                              ValueField="@((PopulationPoint s) => s.Value)" />
            <DxRangeSelectorChartValueAxis ValueType="ChartAxisDataType.Numeric" />
        </DxRangeSelectorChart>
        <DxRangeSelectorBackground Color="#ebf9fa" />
    </DxRangeSelector>
    
    @code {
        List<PopulationPoint> Data;
        protected override void OnInitialized() {
            Data = GetData();
        }
    }
    
    See Also