Jeremy Thomas
Jeremy Thomas

Reputation: 6674

Rails 4 + Chartkick: Update data

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

Answers (1)

user8187893
user8187893

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

Related Questions