1

I am trying to test chart.js zoom plugin example (from official examples folder) locally. Example file name is zoom.html I changed scripts paths to local paths in the example code:

<script src="Chart.bundle.js"></script>
<script src="hammer.min.js"></script>
<script src="chartjs-plugin-zoom.js"></script>

All scripts are latest versions:

Chart.js: 2.7.3

Hammer.js: 2.0.8

chartjs-plugin-zoom: does not have version number, but latest downloaded from github

The zoom does not work and I see the error in console:

Uncaught SyntaxError: Unexpected identifier

in line 3 of chartjs-plugin-zoom.js

so it seems like

import Chart from 'chart.js';

line in the plugin code works wrong. Or maybe I am doing wrong something.

The same error happened when I tried other locations of the libraries.

Sergey Kravchenko
  • 957
  • 1
  • 8
  • 21

1 Answers1

0

You can run the examples by doing:

git clone https://github.com/chartjs/chartjs-plugin-zoom.git
cd chartjs-plugin-zoom
npm install
gulp build
Ben McCann
  • 18,548
  • 25
  • 83
  • 101