-
Notifications
You must be signed in to change notification settings - Fork 69
chartjs-plugin-annotation #34
Comments
@kormizz any help highly appreciated. PRs welcome. |
+1 @kormizz use yii\web\AssetBundle;
class ChartJsAnnotationAsset extends AssetBundle
{
public $sourcePath = '@bower/chartjs-plugin-annotation';
public $js = [
'chartjs-plugin-annotation.js',
];
public $depends = [
'yii\web\JqueryAsset',
'dosamigos\chartjs\ChartJsAsset'
];
} class ChartJs extends \dosamigos\chartjs\ChartJs
{
//add annotation plugin support
protected function registerClientScript()
{
//other way options block in js config is empty and annotations don't work
$this->clientOptions = $this->options;
$view = $this->getView();
ChartJsAnnotationAsset::register($view);
parent::registerClientScript();
}
} Should I make PR(s)? |
@sasha-x that would be great. Please, make sure test work when you do. Thanks. |
Can I get more detail as to where the above code goes? I'm trying to get this plugin to work as well, and would love more details... |
It's a long time but AFAIK: PREPARATION:
OPTION 1 - local usage:
OPTION 2 - global usage:
|
@mkormout a H-U-G-E thank you! I was close, but you got me the rest of the way!! For anyone else that needs a little more info (when going with option 1):
and then the client options part in that view:
Again, thank you so much! |
Any chance to get something like chartjs-plugin-annotation bundled with yii2-chartjs-widget?
Thank you!
EDIT:
For those who needs this, I've already achieved this by:
The text was updated successfully, but these errors were encountered: