This sample demonstrate how to show or hide zooming toolbar items in UWP Chart.
The UWP SfChart Zooming Toolbar encompassed some buttons for performing actions like Zoom In/Out, Resetting, and selection zooming by using the ToolBarItems property.
You can show or hide the zooming toolbar by using the EnableZoomingToolBar property in the ChartZoomPanBehavior as per the following code snippet.
[XAML]
<chart:SfChart>
<chart:SfChart.PrimaryAxis>
<chart:DateTimeAxis LabelFormat="MMM, yyyy"/>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis />
</chart:SfChart.SecondaryAxis>
<chart:SfChart.Behaviors>
<chart:ChartZoomPanBehavior ToolBarItems="ZoomIn,ZoomOut,SelectZooming"
EnableZoomingToolBar="True"
EnableSelectionZooming="True" />
</chart:SfChart.Behaviors>
<chart:FastLineSeries ItemsSource="{Binding Data}"
XBindingPath="Date"
YBindingPath="Load"/>
</chart:SfChart>
If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.
KB article:How to show or hide zooming toolbar items in UWP Chart?