Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

this.state.chart is undefined at componentWillReceiveProps #176

Open
alexfqc opened this issue Mar 30, 2017 · 2 comments
Open

this.state.chart is undefined at componentWillReceiveProps #176

alexfqc opened this issue Mar 30, 2017 · 2 comments

Comments

@alexfqc
Copy link

alexfqc commented Mar 30, 2017

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();
    }
  }
};
@joshi-mehul
Copy link

joshi-mehul commented Aug 1, 2017

@alex3165 it's in core.js right? please provide more data, where you're getting this? I have submitted pull request for this issue.

@Jareechang
Copy link
Collaborator

@alexfqc, could you please provide an example where this is occurring ? Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants