Different methods for loading a chart with Turbolinks support
You should test these in Firefox. In Chrome, each link click triggers a full page reload if running from localhost (which defeats the purpose of Turbolinks, and doesn't present the bug).
One statement: anonymous function in callback
Three statements; load packages, set callback, define function. The first statement crashes.
Two statements; load packages with callback defined, define function.