Browse Source

fix Pie lengendData can not update. fixed: #819

pull/838/head
nikogu 8 years ago
parent
commit
4d03f9c36d
  1. 11
      src/components/Charts/Pie/index.js

11
src/components/Charts/Pie/index.js

@ -26,7 +26,16 @@ export default class Pie extends Component {
componentWillReceiveProps(nextProps) {
if (this.props.data !== nextProps.data) {
this.getLengendData();
// because of charts data create when rendered
// so there is a trick for get rendered time
this.setState(
{
legendData: [...this.state.legendData],
},
() => {
this.getLengendData();
}
);
}
}

Loading…
Cancel
Save