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
+31-3Lines changed: 31 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# react-chartjs-2
4
4
5
-
React wrapper for [ChartJs 2](http://www.chartjs.org/docs/#getting-started)
5
+
React wrapper for [Chart.js 2](http://www.chartjs.org/docs/#getting-started)
6
6
Open for PR's and contributions!
7
7
8
8
@@ -61,8 +61,8 @@ In order for Chart.js to obey the custom size you need to set `maintainAspectRat
61
61
/>
62
62
```
63
63
64
-
### Chart instance
65
-
Chart instance can be accessed by placing a ref to the element as:
64
+
### Chart.js instance
65
+
Chart.js instance can be accessed by placing a ref to the element as:
66
66
67
67
```
68
68
render() {
@@ -75,6 +75,34 @@ render() {
75
75
}
76
76
```
77
77
78
+
### Chart.js Defaults
79
+
Chart.js defaults can be set by importing the `defaults` object:
80
+
81
+
```javascript
82
+
import { defaults } from'react-chartjs-2';
83
+
84
+
// Disable animating charts by default.
85
+
defaults.global.animation=false;
86
+
```
87
+
88
+
If you want to bulk set properties, try using the [lodash.merge](https://lodash.com/docs/#merge) function. This function will do a deep recursive merge preserving previously set values that you don't want to update.
0 commit comments