@@ -48,7 +48,7 @@ class ChartComponent extends React.Component {
48
48
}
49
49
50
50
componentWillMount ( ) {
51
- this . chart_instance = undefined ;
51
+ this . chartInstance = undefined ;
52
52
}
53
53
54
54
componentDidMount ( ) {
@@ -57,7 +57,7 @@ class ChartComponent extends React.Component {
57
57
58
58
componentDidUpdate ( ) {
59
59
if ( this . props . redraw ) {
60
- this . chart_instance . destroy ( ) ;
60
+ this . chartInstance . destroy ( ) ;
61
61
this . renderChart ( ) ;
62
62
return ;
63
63
}
@@ -108,7 +108,7 @@ class ChartComponent extends React.Component {
108
108
}
109
109
110
110
componentWillUnmount ( ) {
111
- this . chart_instance . destroy ( ) ;
111
+ this . chartInstance . destroy ( ) ;
112
112
}
113
113
114
114
transformDataProp ( props ) {
@@ -149,15 +149,15 @@ class ChartComponent extends React.Component {
149
149
150
150
const data = this . memoizeDataProps ( this . props ) ;
151
151
152
- if ( ! this . chart_instance ) return ;
152
+ if ( ! this . chartInstance ) return ;
153
153
154
154
if ( options ) {
155
- this . chart_instance . options = Chart . helpers . configMerge ( this . chart_instance . options , options ) ;
155
+ this . chartInstance . options = Chart . helpers . configMerge ( this . chartInstance . options , options ) ;
156
156
}
157
157
158
158
// Pipe datasets to chart instance datasets enabling
159
159
// seamless transitions
160
- let currentDatasets = ( this . chart_instance . config . data && this . chart_instance . config . data . datasets ) || [ ] ;
160
+ let currentDatasets = ( this . chartInstance . config . data && this . chartInstance . config . data . datasets ) || [ ] ;
161
161
const nextDatasets = data . datasets || [ ] ;
162
162
163
163
// use the key provider to work out which series have been added/removed/changed
@@ -192,12 +192,12 @@ class ChartComponent extends React.Component {
192
192
newDatasets . forEach ( d => currentDatasets . push ( d ) ) ;
193
193
const { datasets, ...rest } = data ;
194
194
195
- this . chart_instance . config . data = {
196
- ...this . chart_instance . config . data ,
195
+ this . chartInstance . config . data = {
196
+ ...this . chartInstance . config . data ,
197
197
...rest
198
198
} ;
199
199
200
- this . chart_instance . update ( ) ;
200
+ this . chartInstance . update ( ) ;
201
201
}
202
202
203
203
renderChart ( ) {
@@ -209,7 +209,7 @@ class ChartComponent extends React.Component {
209
209
options . legend = legend ;
210
210
}
211
211
212
- this . chart_instance = new Chart ( node , {
212
+ this . chartInstance = new Chart ( node , {
213
213
type,
214
214
data,
215
215
options,
@@ -218,7 +218,7 @@ class ChartComponent extends React.Component {
218
218
}
219
219
220
220
handleOnClick = ( event ) => {
221
- const instance = this . chart_instance ;
221
+ const instance = this . chartInstance ;
222
222
223
223
const {
224
224
getDatasetAtEvent,
@@ -258,7 +258,7 @@ export class Doughnut extends React.Component {
258
258
return (
259
259
< ChartComponent
260
260
{ ...this . props }
261
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
261
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
262
262
type = 'doughnut'
263
263
/>
264
264
) ;
@@ -270,7 +270,7 @@ export class Pie extends React.Component {
270
270
return (
271
271
< ChartComponent
272
272
{ ...this . props }
273
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
273
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
274
274
type = 'pie'
275
275
/>
276
276
) ;
@@ -282,7 +282,7 @@ export class Line extends React.Component {
282
282
return (
283
283
< ChartComponent
284
284
{ ...this . props }
285
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
285
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
286
286
type = 'line'
287
287
/>
288
288
) ;
@@ -294,7 +294,7 @@ export class Bar extends React.Component {
294
294
return (
295
295
< ChartComponent
296
296
{ ...this . props }
297
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
297
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
298
298
type = 'bar'
299
299
/>
300
300
) ;
@@ -306,7 +306,7 @@ export class HorizontalBar extends React.Component {
306
306
return (
307
307
< ChartComponent
308
308
{ ...this . props }
309
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
309
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
310
310
type = 'horizontalBar'
311
311
/>
312
312
) ;
@@ -318,7 +318,7 @@ export class Radar extends React.Component {
318
318
return (
319
319
< ChartComponent
320
320
{ ...this . props }
321
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
321
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
322
322
type = 'radar'
323
323
/>
324
324
) ;
@@ -330,7 +330,7 @@ export class Polar extends React.Component {
330
330
return (
331
331
< ChartComponent
332
332
{ ...this . props }
333
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
333
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
334
334
type = 'polarArea'
335
335
/>
336
336
) ;
@@ -342,7 +342,7 @@ export class Bubble extends React.Component {
342
342
return (
343
343
< ChartComponent
344
344
{ ...this . props }
345
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
345
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
346
346
type = 'bubble'
347
347
/>
348
348
) ;
@@ -354,7 +354,7 @@ export class Scatter extends React.Component {
354
354
return (
355
355
< ChartComponent
356
356
{ ...this . props }
357
- ref = { ref => this . chart_instance = ref && ref . chart_instance }
357
+ ref = { ref => this . chartInstance = ref && ref . chartInstance }
358
358
type = 'scatter'
359
359
/>
360
360
) ;
0 commit comments