diff --git a/lib/chartkick/helper.rb b/lib/chartkick/helper.rb index fb7a25d..61934ca 100644 --- a/lib/chartkick/helper.rb +++ b/lib/chartkick/helper.rb @@ -119,6 +119,7 @@ def chartkick_chart(klass, data_source, **options) var createChart = function() { #{createjs} }; if ("Chartkick" in window) { createChart(); + window.addEventListener("turbo:load", createChart, {once: true}); } else { window.addEventListener("chartkick:load", createChart, true); }