Wondering whether there are any CanvasJS npm package can be used for React+Webpack.
Here we tried to install canvasjs from https://www.npmjs.com/package/canvasjs, but build failed with below info:
ERROR in ./node_modules/canvasjs/src/charts/index.js
Module parse failed: Unexpected token (1:7)
You may need an appropriate loader to handle this file type.
| export SplineChart from ‘../charts/spline’;
| export ColumnChart from ‘../charts/column’;
| export StackedColumnChart from ‘../charts/stacked_column’;
@ ./node_modules/canvasjs/src/core/charts.js 40:0-61:25
@ dll vendor
Thanks for your sample, it was helpful for me.
And could you also help provide solution for using CanvasJS in React+Webpack+Typescript, actually the check of Typescript could not support “new CanvasJS.Chart” without define “CanvasJS” first.
We have just released v2.1 with module import/export with which you can easily integrate front-end framework like React, Angular, Vuejs, etc. Please refer to the release blog for more information. Do download the latest version from our download page and let us know your feedback.