Commit 4d03f9c3 authored by nikogu's avatar nikogu

fix Pie lengendData can not update. fixed: #819

parent ac4f6593
......@@ -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();
}
);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment