Open pranavkaushik9 opened 7 years ago
@pranav-xx Could you please provide your code?
for me, when I call the validateNow
method on my amChart (after it was rendered on the screen and nothing else was happening) the whole chart disappears!
@yairEO You shouldn't call validateNow
or validateData
Instead, you should:
This is the normal way to change state in React.
this does not rigger a change in the chart for me though, even though my data is there.. why is that?
@nk2580 I had this issue before when my render method made reference to a config like:
class Chart extends React.Component {
render() {
const { styles, config } = this.props;
return (
<div style={ styles }>
<AmCharts.React options={config} />
</div>
);
}
}
When I made updates to the config prop it wasn't causing re-renders because passing the config to the component was passing by reference. To force the re-render and essentially update the chart, everytime I updated the config prop from the parent component, I would use _.cloneDeep(config) to ensure a new reference is generated.
Hope that sort of helps.
When I change the configuration for chart, it calls validateNow but this is not causing the chart to redraw
https://github.com/amcharts/amcharts3-react/blob/master/amcharts3-react.js#L195