angular-chartist.js
Angular 1.x directive for Chartist.js
Looking for the Angular version?
Installation
Current
npm install angular-chartist.js chartist angular --saveyarn add angular-chartist.js chartist angular
Next
npm install angular-chartist.js@next chartist angular --saveyarn add angular-chartist.js@next chartist angular
Usage
Make sure you have loaded the necessary scripts in the correct order.
Add angular-chartist
as a module dependency, like so:
// >= 4.1;; angular;
In your HTML, add the chartist
directive to any div
or make it a custom element:
Attribute | Type | Required |
---|---|---|
chartist-data |
Object | Yes |
chartist-chart-type |
String | Yes |
chartist-events * |
Object | No |
chartist-chart-options |
Object | No |
chartist-responsive-options |
Array | No |
Format for Chartist events:
{ // do stuff on event }
For the sorts of values these options accept, check out the Chartist.js docs
Using Plugins
Simply put the plugins array in the options
object.
Example:
$scopechartOptions = plugins: Chartistplugins ;
Issues?
This directive is simply a wrapper, anything you pass to the directive gets passed right through to the appropriate method on the Chartist side. Any issues with the charts, data, options, etc, should be filed against Chartist.js
Feel free to file an issue / PR if you feel that the directive can be improved in some way though.