Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

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

    Applies a specific visual range to the argument axis.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    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

    Razor
    <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