Skip to content

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

Closed

Description

@dibsyjr1

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

Activity

  1. etimberg commented on Feb 26, 2016

    @etimberg
    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.

  2. added this to the milestone on Feb 26, 2016
  3. dibsyjr1 commented on Feb 26, 2016

    @dibsyjr1
    ContributorAuthor

    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 :)

  4. etimberg commented on Feb 26, 2016

    @etimberg
    Member

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

  5. dibsyjr1 commented on Feb 26, 2016

    @dibsyjr1
    ContributorAuthor

    Okay that's cool, thanks very much

  6. pavlus commented on Mar 8, 2016

    @pavlus

    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().

  7. modified the milestones: Version 2.5, on Oct 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions