Example of Zooming and Panning in ASP.NET MVC Chart Control

This sample demonstrates the zooming and panning features of the charts.

DEMO
SOURCE

The chart component supports four types of zooming, which can be configured using the enableSelectionZooming, enablePinchZooming, enableMouseWheelZooming, and enableDeferredZooming properties. This sample demonstrates the following zooming and panning behaviors:

  • Selection Zooming : Click and drag the mouse over the chart area to enable selection zooming.
  • Toolbar : Hover over the toolbar at the top-right corner of the chart area to switch between zooming and panning.
  • Pinch Zooming : Pinch in or pinch out on the chart area to zoom in or out on touch-enabled devices.
  • Panning : Touch and drag to pan the chart.
  • Reset Zoom : Double-tap to reset the zoomed chart.

The chart also supports different zooming modes, which can be configured using the mode property.

  • XY - Zoom the chart with respect to both axes.
  • X - Zoom the chart with respect to the horizontal axis only.
  • Y - Zoom the chart with respect to the vertical axis only.

The ToolbarPosition property is used to adjust the position of the zoom toolbar. In this example, the toolbar is moved 60 pixels upward from its default position. The Draggable property is used to drag and drop the zoom toolbar to any position within the chart area.

The chart supports different scrollbar positions. By default, it appears next to the axis line, but you can adjust its placement using the position property of scrollbarSettings. This positioning allows better customization and flexibility in the chart's design.

Tooltip is enabled in this example. To see the tooltip in action, hover over or tap on the chart.

More information on the Zooming can be found in this documentation sectionopens in a new tab.

Transform your ASP.NET MVC web apps today with Syncfusion® ASP.NET MVC components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE
opens in a new tab