Reputation: 6674
I am using Chartkick to draw graphs in my app, but when I try to use the javascript api to update the graph, I get an error in my javascript console:
Uncaught TypeError: chart.updateData is not a function(…)
My chart is defined and visible on the page and can be queried with chart
. Am I missing something obvious, is there something else I need to include?
Upvotes: 1
Views: 623
Reputation: 1
make sure that you actually have that chart object first before you want to update the it using chart = Chartkick.charts['chart_id']
only then can you update that chart using chart.updateData()
Upvotes: 0