Skip to main content

DxChartZoomAndPanSettings.AllowTouchGestures Property

Specifies whether users can use touch gestures to zoom or pan the chart.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(true)]
[Parameter]
public bool AllowTouchGestures { get; set; }

Property Value

Type Default Description
Boolean true

true if touch gestures are enabled; otherwise, false.

Remarks

Users can use the spread and pinch gestures to zoom the chart, and the vertical and horizontal drag gestures to pan the chart. To disable this feature, set the AllowTouchGestures property to false.

@using Chart.Data

<DxChart Data="@SalesData">
    <DxChartLineSeries Name="2017"
                       Filter="@((SaleInfo s) => s.Date.Year == 2017)"
                       ArgumentField="@(s => s.Date)"
                       ValueField="@(s => s.Amount)">
        <DxChartAggregationSettings Enabled="true" Method="ChartAggregationMethod.Sum" />
    </DxChartLineSeries>
    <DxChartZoomAndPanSettings ArgumentAxisZoomAndPanMode="ChartAxisZoomAndPanMode.Both"
                               ValueAxisZoomAndPanMode="ChartAxisZoomAndPanMode.Pan"
                               AllowTouchGestures="false" />
    <DxChartScrollBarSettings ArgumentAxisScrollBarVisible="true"
                              ArgumentAxisScrollBarPosition="ChartScrollBarPosition.Top" />
</DxChart>

@code {
    IEnumerable<SaleInfo> SalesData;

    protected override async Task OnInitializedAsync() {
        SalesData = await Sales.GetSalesAsync();
    }
}

Refer to Zoom and Pan for more information.

Run Demo: Charts - Zoom and Pan

See Also