@@ -18,6 +18,7 @@ class ChartComponent extends React.Component {
1818 legend : PropTypes . object ,
1919 onElementsClick : PropTypes . func ,
2020 options : PropTypes . object ,
21+ plugins : PropTypes . arrayOf ( PropTypes . object ) ,
2122 redraw : PropTypes . bool ,
2223 type : PropTypes . oneOf ( [ 'doughnut' , 'pie' , 'line' , 'bar' , 'horizontalBar' , 'radar' , 'polarArea' , 'bubble' ] ) ,
2324 width : PropTypes . number ,
@@ -60,6 +61,7 @@ class ChartComponent extends React.Component {
6061 redraw,
6162 type,
6263 options,
64+ plugins,
6365 legend,
6466 height,
6567 width
@@ -85,6 +87,10 @@ class ChartComponent extends React.Component {
8587 return true ;
8688 }
8789
90+ if ( ! isEqual ( plugins , nextProps . plugins ) ) {
91+ return true ;
92+ }
93+
8894 const nextData = this . transformDataProp ( nextProps )
8995 return ! isEqual ( this . shadowDataProp , nextData ) ;
9096 }
@@ -183,14 +189,15 @@ class ChartComponent extends React.Component {
183189 }
184190
185191 renderChart ( ) {
186- const { options, legend, type, redraw} = this . props ;
192+ const { options, legend, type, redraw, plugins } = this . props ;
187193 const node = ReactDOM . findDOMNode ( this ) ;
188194 const data = this . memoizeDataProps ( ) ;
189195
190196 this . chart_instance = new Chart ( node , {
191197 type,
192198 data,
193- options
199+ options,
200+ plugins
194201 } ) ;
195202 }
196203
0 commit comments