Back to Devexpress

DxChartAxis<T>.CustomPosition Property

blazor-devexpress-dot-blazor-dot-dxchartaxis-1-bd258c80.md

latest2.8 KB
Original Source

DxChartAxis<T>.CustomPosition Property

Specifies the position of an axis on another axis.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public object CustomPosition { get; set; }

Property Value

TypeDescription
Object

The value (date, number, or string) on another axis where axes intersect.

|

Remarks

Specify the CustomPosition property value in the same format as the values on another axis. If you also specify the Offset property, the Chart shifts the intersection point relative to the CustomPosition property value. If the CustomPosition property value is outside the axis range, the Chart ignores the Offset property value and moves the intersection point to a pane edge. The CustomPosition property overrides the Alignment property.

The following example applies the CustomPosition property to the argument axis:

razor
<DxChart Data="@forecasts">
    <DxChartLineSeries ArgumentField="@((WeatherForecast i) => i.Date)"
                       ValueField="@((WeatherForecast i) => i.TemperatureC)"
                       Name="Temperature, C" />
    <DxChartLineSeries ArgumentField="@((WeatherForecast i) => i.Date)"
                       ValueField="@((WeatherForecast i) => i.TemperatureF)"
                       Name="Temperature, F" />
    <DxChartArgumentAxis CustomPosition="45" />
</DxChart>
csharp
namespace Chart.Data {
    using System;

    public class WeatherForecast {
        public DateTime Date { get; set; }
        public int TemperatureC { get; set; }
        public double TemperatureF => Math.Round((TemperatureC * 1.8 + 32), 2);
        public double Precipitation { get; set; }
    }
}

If your Chart contains multiple value axes, specify the CustomPositionAxisName property to define the value axis that the argument axis intersects at the CustomPosition value.

Run Demo: Chart Axes - Custom Position

See Also

DxChartAxis<T> Class

DxChartAxis<T> Members

DevExpress.Blazor Namespace