Home forums Using CanvasJS chart object inside an array cause render() problems

This topic contains 2 replies, has 2 voices, and was last updated by  Suyash Singh 1 week, 1 day ago.

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

    jiann4321
    Member

    Good Day,

    I put the chart object inside an array

    chartArr = [chart1, chart2]
    
    fnction updateChart(graphId) {
    
     chartArr.forEach((d) => {
      if(d.id === graphId) {
        d.render()
      } 
     })
    }

    When I call the function of the first chart it does update the first chart correctly. but when I call the function of the second chart, it somehow copies the data on the first chart and it will look exactly alike.

    #17261

    jiann4321
    Member

    The chart have different canvases i already checked. If I update the first chart it will only update the first chart but the second or third or x number of charts, it just copies the data from chart 1

    #17267

    Suyash Singh
    Moderator

    @jiann4321,

    Can you kindly create a jsfiddle reproducing the issue you are facing, so that we can understand the issue better and help you out.

    ___
    Suyash Singh
    Team CanvasJS

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

You must be logged in to reply to this topic.