Home forums Using CanvasJS Refresh Bar Chart in React JS Failed

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Shashi Ranjan 2 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26721

    I tried to import bar chart using react js.
    However the chart cannot refresh when the state changes.
    (To be exact, the values in the bars change but the length of the bars don’t)
    I tried to rerender/forceupdate but it seems useless.
    Can any one provide me the solution?
    Many Thanks.

    #26722

    solutions found!

    Activate this code
    onRef={ref => this.chart = ref}

    And add this.chart.render() in the place you want to refresh the chart.

    #26739

    @stephenchankyand-co,

    Glad that you found the solution :) Please refer documentation page on React for more information.


    Shashi Ranjan
    Team CanvasJS

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.