diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index ac5703ce29215db845c72ca35fec098a15ae271f..528b2519d21b41dc3fbd75ffa5c3270534400c1b 100644 --- a/src/components/Charts/Pie/index.js +++ b/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(); + } + ); } }