2amigos / yii2-chartjs-widget

ChartJs Widget For Yii2
https://2amigos.us
Other
108 stars 67 forks source link

directory to be published does not exist: chartjs/dist #44

Closed mrbig00 closed 4 years ago

mrbig00 commented 4 years ago

In the latest release dev-master charts js no more includes the dist folder, so an error is thrown when using the widget:

Invalid Argument – yii\base\InvalidArgumentException The file or directory to be published does not exist: /shared/httpd/project/vendor/bower-asset/chartjs/dist

libedux commented 4 years ago

Had to downgrade my version but now it gives "TypeError: (new Chart(...)).bar is not a function" error

zertex commented 4 years ago

+1

tonydspaniard commented 4 years ago

i'll have a look at it. thanks.

tonydspaniard commented 4 years ago

fixed on new version 3.0

denostr commented 4 years ago

Run composer require nnnick/chartjs "v2.9.3"

And add to config:

'components' => [
    'assetManager' => [
        'bundles' => [
            'dosamigos\chartjs\ChartJsAsset' => [
                'sourcePath' => '@vendor/nnnick/chartjs/dist',
            ],
        ],
    ],
],
fasi1208 commented 4 years ago

Run composer require nnnick/chartjs "v2.9.3"

And add to config:

'components' => [
    'assetManager' => [
        'bundles' => [
            'dosamigos\chartjs\ChartJsAsset' => [
                'sourcePath' => '@vendor/nnnick/chartjs/dist',
            ],
        ],
    ],
],

Now it's giving me Setting read-only property: yii\web\Application::assetManager

denostr commented 4 years ago

@fasi1208 You must add assetManager configuration into components section, check it

fasi1208 commented 4 years ago

@fasi1208 You must add assetManager configuration into components section, check it

Where to add it? means in composer.json where to add it ?

denostr commented 4 years ago

@fasi1208 In your config file, for example backend/config/main.php For example

fasi1208 commented 4 years ago

@fasi1208 In your config file, for example backend/config/main.php For example

added now I am getting Failed to create chart: can't acquire context from the given item also posted a question at stack

abreupardom commented 1 year ago

to me work!!! with 2.9.4.

composer require nnnick/chartjs "v2.9.4"

image

image

image

some people know how can use on 4.2.0, the "dist" folder no exist