Skip to main content

Zooming and Panning

Zooming and panning allow users to explore chart data in greater detail by focusing on specific regions of the chart.

Zoom Types

Highcharts supports several zoom types that can be configured on the chart level.

Basic Zoom Configuration

Zoom Methods

Selection-Based Zoom

The default zoom method where users drag to select an area:

Mouse Wheel Zoom

Enable zooming with the mouse wheel:

Pinch to Zoom

On touch devices, pinch gestures enable zooming:

Single Touch Zoom

Enable zoom by dragging with a single finger:

Reset Zoom Button

When users zoom in, a reset button appears to return to the original view.

Basic Reset Button

Custom Reset Button Position

Custom Reset Button Theme

Panning

Panning allows users to move around a zoomed chart without zooming out.

Enable Panning

1

Basic Panning

Enable panning on one or both axes:
2

Pan Key

Require a modifier key for panning:
Available keys: 'shift', 'ctrl', 'alt', 'meta'
3

Panning Type

Control which axes can be panned:

Programmatic Zooming

Zoom charts programmatically using API methods:

Zoom to Range

Reset Zoom Programmatically

Zoom on Chart Events

Boost Module for Large Datasets

For charts with large datasets, use the Boost module to maintain zoom performance:

Zooming on Different Chart Types

Polar Charts

Non-Cartesian Series

For pie charts and other non-cartesian types, use the NonCartesianSeriesZoom module:

Advanced Zoom Features

Scrollbar for Navigation

Combine zooming with a scrollbar:

Min/Max Zoom Range

Set limits on how far users can zoom:

Zoom Animation

Accessibility

Ensure zoom features are accessible:

Best Practices

Zoom Performance Tips
  • Use the Boost module for datasets with > 1000 points
  • Enable useGPUTranslations for better performance
  • Consider using turboThreshold to optimize large datasets
  • Use pointStart and pointInterval instead of explicit x values
Important Considerations
  • Zooming is not supported on all chart types (e.g., pie charts)
  • Mobile devices may require specific touch configurations
  • Consider showing instructions for zoom controls
  • Test zoom behavior on different screen sizes
  • Pan key modifiers may not work on all operating systems

Complete Example