- Issue created by @tjtj
- πΊπΈUnited States andileco
Thank you for reporting. What version of Drupal are you on? What are the steps you took before the error occurred? Did you already have charts installed?
- πΊπΈUnited States tjtj
11.1.4.
I get a message in reports that I need a plugin.Chart.js Library
Not Installed
You are missing the Chart.js library in your Drupal installation directory and you have opted not to use a CDN. Please either enable use of the CDN in the Chart Settings under the Advanced tab or see the README file inside charts_chartjs for instructions to install the library.So I went the Charts setting to fix this, and pow!
- πΊπΈUnited States tjtj
Please provide some info on how to install the chart.js library too.
- πΊπΈUnited States andileco
For that, please check out the README.md in charts_chartjs. I'll look into this issue.
- πΊπΈUnited States andileco
I've tried to replicate this and haven't been able to. Any more ideas how I can get it to fail?
- πΊπΈUnited States andileco
It's inside the charts module: charts/modules/charts_chartjs/README.md
- πΊπΈUnited States tjtj
That is really complicated. Shouldn't charts install the necessary library for me?
- πΊπΈUnited States andileco
Some people need that build step where they can have Composer pull in the libraries. You can also just place the files you need inside a properly named libraries directory. Or you can use the CDN option. There are other modules that can help install libraries, too.
I'm not sure how you got to where you are, as I tried on a fresh site and didn't experience any issues. But if you wanted to start fresh, you could try uninstalling and reinstalling Charts, you can go to /admin/config/content/charts, select your chosen charting library, hit save, then visit the "Advanced" tab and make sure the CDN is enabled.
Hope this helps!
- πΊπΈUnited States tjtj
I went through the steps in README.md, in /public_html/blogs/web/modules/contrib/charts/modules/charts_chartjs, but I do not get a charts library. The last step gives:
-bash: npm-asset/chartjs-adapter-date-fns:^3.0: No such file or directory -bash: npm-asset/chartjs-plugin-datalabels:^2.0: No such file or directory
I tried both ways in composer.json.
"extra": { "installer-types": ["npm-asset"], "installer-paths": { "web/libraries/chart.js": ["npm-asset/chart.js"], "web/libraries/chartjs-adapter-date-fns": [ "npm-asset/chartjs-adapter-date-fns" ], "web/libraries/chartjs-plugin-datalabels": [ "npm-asset/chartjs-plugin-datalabels" ], }, } NOTE: If this isn't working, try instead adding: "extra": { "installer-types": ["npm-asset"], "installer-paths": { ... "web/libraries/{$name}": ["type:drupal-library", "vendor:npm-asset"] }, }
I reinstalled charts, and CDN was selected. And the error is gone. Sorry about bothering you.