Back to Devexpress

ChartAxisDataType Enum

blazor-devexpress-dot-blazor-094460a2.md

latest3.6 KB
Original Source

ChartAxisDataType Enum

Lists values that specify whether and how to cast the chart’s arguments and values.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public enum ChartAxisDataType

Members

NameDescription
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.

|

The following properties accept/return ChartAxisDataType values:

Remarks

The following example casts the chart’s arguments to the DateTime type and values to a numeric type.

razor
<DxChart Data="@GetData()">
    <DxChartTitle Text="@($"Daily rainfall, mm")" />
    <DxChartArgumentAxis ArgumentType="ChartAxisDataType.DateTime" />
    <DxChartValueAxis ValueType="ChartAxisDataType.Numeric" />
    <DxChartLegend Visible="false" />
    <DxChartBarSeries ArgumentField="@((DataPoint s) => s.Argument)" ValueField="@((DataPoint s) => s.Value)" />
</DxChart>
csharp
@code {
    List<DataPoint> GetData() {
        List<DataPoint> result = new List<DataPoint>(6);
        result.Add(new DataPoint("2019-03-10", "11.5"));
        result.Add(new DataPoint("2019-03-08", "10.2"));
        result.Add(new DataPoint("2019-03-07", "8.3"));
        result.Add(new DataPoint("2019-03-06", "11.0"));
        result.Add(new DataPoint("2019-03-04", "4.2"));
        result.Add(new DataPoint("2019-03-01", "5.5"));
        return result;
    }

    struct DataPoint {
        public DataPoint(string argument, string value) { Argument = argument; Value = value; }
        public string Argument { get; set; }
        public string Value { get; set; }
    }
}

See Also

DevExpress.Blazor Namespace