Skip to content

Commit 8a016f1

Browse files
committed
update docs
1 parent 73d8eab commit 8a016f1

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

docs/data/charts/zoom-and-pan/zoom-and-pan.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@ The following options are available:
4141

4242
{{"demo": "ZoomOptionsNoSnap.js", "hideToolbar": true, "bg": "playground"}}
4343

44-
## Controlled zoom
45-
46-
You can control the zoom state by setting the `zoom` and `onZoomChange` props.
47-
This way, you can control the zoom state from outside the chart.
48-
49-
The `onZoomChange` prop is a function that receives the new zoom state.
50-
51-
While the `zoom` prop is an array of objects that define the zoom state for each axis with zoom enabled.
52-
53-
- **axisId**: The id of the axis to control.
54-
- **start**: The starting percentage of the axis range.
55-
- **end**: The ending percentage of the zoom range.
56-
57-
{{"demo": "ZoomControlled.js"}}
58-
5944
## Zoom filtering
6045

6146
You can make the zoom of an axis affect one or more axes extremums by setting the `zoom.filterMode` prop on the axis config.
@@ -66,3 +51,20 @@ You can make the zoom of an axis affect one or more axes extremums by setting th
6651
See how the secondary axis adapts to the visible part of the primary axis in the following example.
6752

6853
{{"demo": "ZoomFilterMode.js"}}
54+
55+
## External zoom management
56+
57+
You can manage the zoom state by two means:
58+
59+
- By defining an initial state with the `initialZoom` prop.
60+
- By imperatively set a zoom value with the `setZoomData` method of the public api.
61+
62+
In addition, the `onZoomChange` prop is a function that receives the new zoom state.
63+
64+
The `zoom` state is an array of objects that define the zoom state for each axis with zoom enabled.
65+
66+
- **axisId**: The id of the axis to control.
67+
- **start**: The starting percentage of the axis range.
68+
- **end**: The ending percentage of the zoom range.
69+
70+
{{"demo": "ZoomControlled.js"}}

0 commit comments

Comments
 (0)