You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,23 @@ import {Doughnut} from 'react-chartjs-2';
40
40
* data: PropTypes.object.isRequired,
41
41
* height: PropTypes.number,
42
42
* legend: PropTypes.object,
43
+
* onElementsClick: PropTypes.func,
43
44
* options: PropTypes.object,
44
45
* redraw: PropTypes.bool,
45
46
* width: PropTypes.number
46
47
48
+
### Events
49
+
50
+
#### onElementsClick (function)
51
+
52
+
A function to be called when mouse clicked on chart elememts, will return all element at that point as an array. [Check](https://github.com/chartjs/Chart.js/blob/master/docs/09-Advanced.md#getelementsatevente)
53
+
54
+
```
55
+
{
56
+
onElementsClick: (elems) => {}
57
+
// `elems` is an array of chartElements
58
+
}
59
+
```
47
60
48
61
## Development (`src`, `lib` and the build process)
0 commit comments