I am currently in the process of developing a customized extension and I need to use Chart.js for this project.
The necessary imports are as follows:
define( [
'jquery',
'./PropertiesPannel',
'//cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.js',
'//cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js',
'//cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="086b60697a7c627b2578647d6f61df33657c"><span class="__cf_email__" data-cfemail="65e1ededfc">[email protected]</span></a>/dist/chartjs-plugin-zoom.min.js'
],
function ( $, ProperitesPannel, Chart) {
'use strict';
....
An error message is showing up in the Console:
hammerjs.js:1 Uncaught SyntaxError: Unexpected token '<'
3setup-view.d91ae8b7669a979d2ec1.js:8 TypeError: Cannot read property 'helpers' of undefined
at chartjs-plugin-zoom.min.js:11
at Object.execCb (setup-view.d91ae8b7669a979d2ec1.js:8)
at n.check (setup-view.d91ae8b7669a979d2ec1.js:8)
at n.<anonymous> (setup-view.d91ae8b7669a979d2ec1.js:8)
at setup-view.d91ae8b7669a979d2ec1.js:8
at setup-view.d91ae8b7669a979d2ec1.js:8
at each (setup-view.d91ae8b7669a979d2ec1.js:8)
at n.emit (setup-view.d91ae8b7669a979d2ec1.js:8)
at n.check (setup-view.d91ae8b7669a979d2ec1.js:8)
at n.enable (setup-view.d91ae8b7669a979d2ec1.js:8)
I understand that the chartjs Plugin file needs to be linked with the chart file and hammer. How can I make sure these dependencies are properly connected?