ChartVisualRangeChangeSource Enum
Lists operations that change axis visual ranges.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public enum ChartVisualRangeChangeSource
Members
Name | Description |
---|---|
ZoomAction
|
Users zoom in/out the chart (using the mouse wheel, zoom/pinch gestures, or drag box). |
PanAction
|
Users pan the chart (using the mouse, scrollbar, or swipe gestures). |
ApiCall
|
You call the SetArgumentAxisVisualRange, SetValueAxisVisualRange, or ResetVisualRange method. |
Related API Members
The following properties accept/return ChartVisualRangeChangeSource values:
Remarks
Handle the VisualRangeChanged event to react to axis visual range changes. The ChangeSource event argument identifies an operation that triggered the event.
Example
The following code snippet shows information about visual range changes only when a user pans the chart along the value axis:
@inject ICurrencyExchangeDataProvider UsdJpyDataProvider
<DxChart @ref="@chart"
T="DatePricePoint"
Data="@UsdJpyData"
VisualRangeChanged="@OnVisualRangeChanged"
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 ValueAxisZoomAndPanMode="ChartAxisZoomAndPanMode.Both"
ArgumentAxisZoomAndPanMode="ChartAxisZoomAndPanMode.Both"/>
<DxChartScrollBarSettings ArgumentAxisScrollBarVisible="true"
ArgumentAxisScrollBarPosition="ChartScrollBarPosition.Bottom" />
</DxChart>
@code {
IEnumerable<DatePricePoint> UsdJpyData;
DxChart<DatePricePoint> chart;
DateTime startDate = new DateTime(2020, 01, 01);
DateTime endDate = new DateTime(2021, 01, 29);
void OnVisualRangeChanged(ChartVisualRangeChangedEventArgs args) {
if (!args.IsArgumentAxis && args.ChangeSource == ChartVisualRangeChangeSource.ZoomAction) {
var previousRange = args.PreviousRange;
var currentRange = args.CurrentRange;
ShowDetailDialog(previousRange, currentRange);
}
}
// ...
protected override async Task OnInitializedAsync() {
UsdJpyData = await UsdJpyDataProvider.GetDataAsync();
}
}