Search code examples
javascriptphpmysqlgoogle-visualization

Second Graph is not showing up chart.js, mysql in php


I can't figure out why my second graph isn't showing on web? I am using chart.js and querying data from mysql, and graphing it. I have two functions drawChat1 and drawChart2. drawChart1 is working fine and showing graph but no data is showing for drawChart2. I left a picture for reference.

UPDATE: it is the id's. I tried rearrange the order in which I call them, and now graph2 is showing whereas graph1 isn't. But how do I fix this? I have no clue.


Solution

  • You are usign vars so high chance its a name conflict, if you switch the naming of your draw2 method to data2, options2 and chart2 it will work.