Skip to content

Adding other plugins #3

Description

@undsoft

Hey,

Thanks for the extension.
I wonder how I can add custom Flot plugin.
Let's say I want to install flot.curvedLines.

I do:

composer require bower-asset/flot.curvedLines

Then I create my FlotCurvedLinesAsset, where I register all the files.
I need to reference your ChartAsset as a dependency.

class FlotCurvedLinesAsset extends AssetBundle
{
    public $sourcePath = '@bower/flot.curvedlines';

    public $baseUrl = '@web';

    public $js = [
        'curvedLines.js'
    ];

    public $depends = [
        'yii\web\JqueryAsset',
        'bburim\flot\ChartAsset'
    ];
}

But because of the way you are adding your plugins ChartAsset::$extra_js, all the plugins get broken.
I think it would be better if you had an AssetBundle for every plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions