4๐
I was able to solve this by fetching the library from the CDN rather than downloading it. To do this, I first unpinned the downloaded version:
bin/importmap unpin chart.js --download
and then I repinned it without downloading:
bin/importmap pin chart.js
And now it works!
- [Chartjs]-Format Bar Chart's yAxis labels in Chart.js
- [Chartjs]-How to draw Horizontal line on Bar Chart Chartjs
0๐
As of August 2023, the setup for Chartkick (which uses chart.js) with Importmap is described in the Chartkick documentation, which worked for me.
Importmap
In config/importmap.rb, add:
pin "chartkick", to: "chartkick.js"
pin "Chart.bundle", to: "Chart.bundle.js"
And in app/javascript/application.js, add:
import "chartkick"
import "Chart.bundle"
- [Chartjs]-How to change tooltip on Angular Chart.js
- [Chartjs]-Show label in tooltip but not in x axis for chartjs line chart
Source:stackexchange.com