-
Notifications
You must be signed in to change notification settings - Fork 78
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
Charts: Changing the chart type doesn't remove old class name #3144
Comments
Seems like the destroy of chart is not doing removing the class. |
Yes, I tried doing a manual |
yeah i think the chart "reseting" is also calling destroy. So that's where the fix would lie. |
FYI - As a workaround, I'm removing all classes from the container and then adding back in |
Yeah that works. I think our code would individual destroy each component (chart) and each should strip its class. |
Descoping some older issues we didnt get a chance to complete. |
@tmcconechy we'd still like this addressed at some point. What's the correct way to keep this in your backlog? |
Ok, For more details: We can fix it but i was thinking that going forward it would be individual charts so you won't be able to switch the type depending on chart. For example pie and donut is probably a setting but pie to bar is a seperate chart. But bar to bar grouped is the same chart ect... So you will in the future have to just invoke one or the other and hide/show. But the fix for this in the meantime is fairly simple so can do it but going forward it wont be possible anymore. (Also the classes wont matter so much anyways) |
…olutions need to confirm before raising a PR
This issue is now resolved. |
You can reproduce locally by initializing a chart with a pie chart type and then calling the
.chart(settings)
with a different chart type and a different dataset (optional). You can also reproduce on the IDS demo by:var areaData = [{ data: [{ name: 'Component D', value: 10.1, id: 'A', tooltip: 'Component D <b>{{percent}}</b>' }, { name: 'Component E', value: 12.2, id: 'B', tooltip: 'Component E <b>{{percent}}</b>' }] }];
$('#pie-chart-example').chart({type: 'area', dataset: areaData});
chart-container
class still haschart-pie
even though it is no longer a pie chart.Expected:
chart-pie
class to be removed and replaced by new chart type class (line-chart
in this case).The text was updated successfully, but these errors were encountered: