Add parameters to tooltip filter option (#7556)

This commit is contained in:
Ben McCann
2020-06-29 04:51:20 -07:00
committed by Evert Timberg
parent aa523da832
commit 49f18c262c
4 changed files with 4 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ Allows sorting of [tooltip items](#tooltip-item-interface). Must implement at mi
### Filter Callback
Allows filtering of [tooltip items](#tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.filter](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter). This function can also accept a second parameter that is the data object passed to the chart.
Allows filtering of [tooltip items](#tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.filter](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter). This function can also accept a fourth parameter that is the data object passed to the chart.
## Tooltip Callbacks

View File

@@ -185,6 +185,7 @@ Animation system was completely rewritten in Chart.js v3. Each property can now
#### Tooltip
* `xLabel` and `yLabel` were removed. Please use `index` and `value`
* The `filter` option will now be passed additional parameters when called and should have the method signature `function(tooltipItem, index, tooltipItems, data)`
## Developer migration