chartist-js / chartist

Simple responsive charts
https://chartist.dev
MIT License
13.35k stars 2.53k forks source link

Chartist plugins in vue #1056

Open hrvylein opened 6 years ago

hrvylein commented 6 years ago

How can I use chartist plugins in vue with webpack?

I actually import Chartist from 'Chartist' and then require('chartist-plugin-legend') and require('chartist-plugin-pointlabels').

Calling the plugin with Chartist.plugins.lengend() gives error "Cannot read from undefined" and

./node_modules/Chartist/dist/chartist.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* C:\Entwicklung\Projekte\vue\rdp-frontend\node_modules\Chartist\dist\chartist.js
    Used by 1 module(s), i. e.
    C:\Entwicklung\Projekte\vue\rdp-frontend\node_modules\babel-loader\lib\index.js!C:\Entwicklung\Projekte\vue\rdp-frontend\node_modules\vue-loader\lib\selector.js?type=script&index=0!C:\Entwicklung\Projekte\vue\rdp-frontend\src\components\sub\sub_overview.vue
* C:\Entwicklung\Projekte\vue\rdp-frontend\node_modules\chartist\dist\chartist.js
    Used by 1 module(s), i. e.
    C:\Entwicklung\Projekte\vue\rdp-frontend\node_modules\chartist-plugin-legend\chartist-plugin-legend.js
 @ ./node_modules/Chartist/dist/chartist.js
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/sub/sub_overview.vue
 @ ./src/components/sub/sub_overview.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

Plugins don't seem to work and neither do the workarounds with import * or assinging window.Chartist = Chartist after import.

Any help?

vinayakkulkarni commented 6 years ago

Maybe This will help