Skip to content

Chart Navigation

Built-in zoom and scroll controls at the bottom center of each chart. Pan and zoom with the mouse or touch on the chart itself (chart engine behavior).

Usage

The navigation bar has five buttons:

ButtonActionDescription
Zoom outShow more bars
+Zoom inShow fewer bars with more detail
Move leftScroll ~25% of the visible range toward older data
Move rightScroll ~25% of the visible range toward newer data
ResetRestore initial bar spacing, scroll to latest bar, reset Y-axis auto-scale

Controls appear per chart when enabled.

Configuration

OptionTypeDefaultDescription
chartNavigationEnabledbooleantrueShow/hide bottom-center navigation controls
typescript
new ChartSpire({
  chartNavigationEnabled: true,
  // ...
})

See Widget API — Constructor for all options.

Programmatic scroll and zoom use Chart API methods on a chart handle:

typescript
chartspire.getActiveChart()?.scrollToRealTime()
chartspire.getActiveChart()?.scrollToTimestamp(1649962800000)
chartspire.getActiveChart()?.scrollByDistance(100)
chartspire.getActiveChart()?.zoomAtDataIndex(1.2, 100)
chartspire.getActiveChart()?.zoomAtTimestamp(1.3, 1649962800000, 200)

See Chart API — Scroll and zoom.

Reset behavior

The button restores the view from when the chart first loaded:

  • X-axis — Original bar spacing and scroll to the latest bar
  • Y-axis — Auto-scale reset for all Y axes on the chart