Skip to content
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

Will it ever be possible for the update function to update the options of the chart as well? #2060

Closed
dibsyjr1 opened this issue Feb 26, 2016 · 5 comments

Comments

@dibsyjr1
Copy link
Contributor

Hi,

i'm looking to switch between a regular bar chart and a stacked bar chart on the fly. At the moment this is only possible by destroying and re-creating the chart but this causes a flicker when doing so (as the chart is essentially being removed and put back onto the web page). I thought it would be much more efficient to be able to update the options seeing as we are only looking to toggle stacked and the title of the chart. Just wondering if this will ever be possible?

Thanks

@etimberg
Copy link
Member

@dibsyjr1 this is not currently supported in either version 1 or version 2. It should be possible, the most annoying thing would be the performance decrease caused by re-merging the config with the global config.

@etimberg etimberg added this to the Future milestone Feb 26, 2016
@dibsyjr1
Copy link
Contributor Author

Hi, thanks for the reply.

I understand that it would cause a performance decrease. Was just thinking you could have a prototype method (hardUpdate for example) that people can choose to call as an alternative to the update function, which would as a result update the entire chart, including options. Kind of like how when update is called, render is subsequently called, but instead it'd be hardUpdate, calling update which in turn calls render (so hardUpdate would only contain the required code to update the options). Just so the functionality is there if someone were to require it without forcing the performance decrease on everyone who wanted to call update.

Thanks again :)

@etimberg
Copy link
Member

Yup, I think we can provide this functionality though it won't make the 2.0.0 release

@etimberg etimberg added the v2.x label Feb 26, 2016
@dibsyjr1
Copy link
Contributor Author

Okay that's cool, thanks very much

@pavlus
Copy link

pavlus commented Mar 8, 2016

Why not just add another function for this? And don't use update() as God-function, but divide it by steps, or even remove it leaving something like updateConfig(), updateData() and render().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants