Skip to main content
All docs
V24.2

DxChart<T>.SetArgumentAxisVisualRange(List<Object>) Method

Applies a specific visual range to the argument axis.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public void SetArgumentAxisVisualRange(
    List<object> range
)

Parameters

Name Type Description
range List<Object>

The data range.

Remarks

Call the SetArgumentAxisVisualRange method to modify the visual range of the argument axis.

You can also apply a specific visual range to the value axis using the SetValueAxisVisualRange method. To reset visual ranges for all axes, call the ResetVisualRange() method.

To respond to visual range changes, handle the Chart’s VisualRangeChanged event.

Example

The following code snippet displays a custom Reset Zoom button that sets the argument axis visual range to the initial range (specified via DxChartAxisRange.StartValue and DxChartAxisRange.EndValue properties):

DxChart - Set Argument Axis Visual Range

<DxChart @ref="@chart"
         T="DatePricePoint"
         Data="@UsdJpyData"
         Width="100%">
    @* ... *@
    <DxChartLineSeries T="DatePricePoint"
                       TArgument="DateTime"
                       TValue="double"
                       ArgumentField="i => i.DateTimeStamp"
                       ValueField="i => i.Price"
                       Name="USDJPY">
        <DxChartSeriesPoint Visible="false" />
        <DxChartAggregationSettings Enabled="true"
                                    Method="ChartAggregationMethod.Average" />
    </DxChartLineSeries>
    <DxChartArgumentAxis>
        <DxChartAxisRange StartValue="startDate"
                          EndValue="endDate" />
    </DxChartArgumentAxis>
    <DxChartZoomAndPanSettings ArgumentAxisZoomAndPanMode="ChartAxisZoomAndPanMode.Both" />
    <DxChartScrollBarSettings ArgumentAxisScrollBarVisible="true"
                              ArgumentAxisScrollBarPosition="ChartScrollBarPosition.Bottom" />
</DxChart>

<DxButton Text="Reset Zoom" Click="@SetArgumentAxisVisualRange" />

@code {
    IEnumerable<DatePricePoint> UsdJpyData;
    DxChart<DatePricePoint> chart;
    @inject ICurrencyExchangeDataProvider UsdJpyDataProvider

    DateTime startDate = new DateTime(2020, 01, 01);
    DateTime endDate = new DateTime(2021, 01, 29);

    public void SetArgumentAxisVisualRange() {
        chart.SetArgumentAxisVisualRange([startDate, endDate]);
    }

    protected override async Task OnInitializedAsync() {
        UsdJpyData = await UsdJpyDataProvider.GetDataAsync();
    }
}

Run Demo: Chart - Zoom and Pan

See Also