Skip to content

Commit

Permalink
Further update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joshkel committed May 24, 2022
1 parent 9a547e5 commit f14b9fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/guide/developers.md
Expand Up @@ -44,7 +44,7 @@ Returns whether the chart has been zoomed or panned - i.e. whether the initial s

## Custom Scales

You can extend chartjs-plugin-zoom with support for [custom scales](https://www.chartjs.org/docs/latest/developers/axes.html) by using the zoom plugin's `zoomFunctions` and `panFunctions` members. These objects are indexed by scale types (scales' `id` members) and give optional handlers for zoom and pan functionality.
You can extend chartjs-plugin-zoom with support for [custom scales](https://www.chartjs.org/docs/latest/developers/axes.html) by using the zoom plugin's `zoomFunctions`, `zoomRectFunctions`, and `panFunctions` members. These objects are indexed by scale types (scales' `id` members) and give optional handlers for zoom and pan functionality.

```js
import {Scale} from 'chart.js';
Expand All @@ -59,8 +59,8 @@ MyScale.defaults = defaultConfigObject;
zoomPlugin.zoomFunctions.myScale = (scale, zoom, center, limits) => false;
zoomPlugin.zoomRectFunctions.myScale = (scale, from, to, limits) => false;
zoomPlugin.panFunctions.myScale = (scale, delta, limits) => false;
// zoomRectFunctions can normally be omitted; chartjs-plugin-zoom can translate
// to an equivalent zoomFunctions call.
// zoomRectFunctions can normally be omitted, since zooming by specific pixel
// coordinates rarely needs special handling.
```

The zoom, zoomRect, and pan functions take the following arguments:
Expand Down

0 comments on commit f14b9fe

Please sign in to comment.