I am using the Charts module for displaying charts in my Drupal project.
When I took the chart API example module page
, it's not displaying any. It throws me this error (in the console):
Uncaught TypeError: $(...).highcharts is not a function
Any idea on how to resolve this issue? Or is there anything additional to do after installing the module?
I enabled all the sub-modules of the Chart module:
And I selected Highcharts
as the Charting library option:
Notes:
- I added the chart js file inside
charts/modules/charts_api_example
and referenced thecharts_highcharts.js
file in thecharts_api_example.libraries.yml
file. - I think the issue may be because jQuery must be loaded before Highcharts when checked the view source on the API examples page the jQuery is loaded at last after the Highcharts library. Not sure though that's the issue.
charts/modules/charts_api_example
and referenced thecharts_highcharts.js
file in thecharts_api_example.libraries.yml
filecharts/modules/charts_api_example
submodule and run composer require --prefer-dist google/charts:45 after modifying the composer.json in the repositories section by addinggoogle_charts
package