-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options object not being changed after setState #64
Comments
@marcelobaez Could you please show me the |
This is the code i've been using so far. Its a function wich returns one chart for each serie received: `renderChart(serie) {
}` This produces charts dynamically for each serie passed to the function. But when the options object is changed (via this.setState), the charts wont update. |
The problem is that There are three ways to create a deep copy:
|
I've been having the same issue as @marcelobaez . I'll try your suggestion @Pauan and let you know how it goes. |
@Pauan This has solved my issue. |
Hi I have a similar issue I think but i m not really sure what i m doing bad, here is my code: `import React from 'react' class Chart extends React.Component { getMinPeriodFromData = (frequency) => { baseChartSeriesStructure = (dataProvided, frequency) => {
}; chartLine = (dataProvided, graphs, frequency) => {
}; chartBar = (dataProvided, graphs, frequency) => {
}; chartStackedBar = (dataProvided, graphs, frequency) => {
}; getOptionsByType = (typeChart, dataProvided, graphs, frequency) => { mapDataToObject = data => data.map(elem => { render() {
} Chart.propTypes = {}; My problem is when I change the type of chart from bar or line to stacked bar and everythink crush then Im not sure why but it looks like each time I change (add or remove) a key in the options json it crush I have proved all the suggested options and any of them works for me By the way my amcharts react version is "@amcharts/amcharts3-react": "^3.0.4", |
I'm generating one <Amchart.React /> for each dataset that I have array of datasets. The state is being changed, however the graph never gets updated because of this condition never reach:
`var didUpdate = updateObject(this.state.chart, oldProps.options, this.props.options);
So I asume the oldProps and the new Props are evaluating the same object. I've followed the examples to pass options objects
The text was updated successfully, but these errors were encountered: