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
{{ message }}
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
this.state.chart is undefined at componentWillReceiveProps #176
classData.componentWillReceiveProps = function(nextProps) {
var chart = this.state.chart; // can be undefined
if (chart) { // if not undefined then do the action
if (nextProps.redraw) {
chart.destroy();
this.initializeChart(nextProps);
} else {
dataKey = dataKey || dataKeys[chart.name];
updatePoints(nextProps, chart, dataKey);
if (chart.scale) {
chart.scale.xLabels = nextProps.data.labels;
if (chart.scale.calculateXLabelRotation){
chart.scale.calculateXLabelRotation();
}
}
chart.update();
}
}
};
classData.componentWillReceiveProps = function(nextProps) {
var chart = this.state.chart; // can be undefined
if (chart) { // if not undefined then do the action
if (nextProps.redraw) {
chart.destroy();
this.initializeChart(nextProps);
} else {
dataKey = dataKey || dataKeys[chart.name];
updatePoints(nextProps, chart, dataKey);
if (chart.scale) {
chart.scale.xLabels = nextProps.data.labels;