5.0.0-beta.2 • Published 6 years ago

angular-chartist.js v5.0.0-beta.2

Weekly downloads
2,111
License
MIT
Repository
github
Last release
6 years ago

angular-chartist.js

CircleCI

Angular 1.x directive for Chartist.js

Looking for the Angular version?

Installation

Current

npm install angular-chartist.js chartist angular --save
yarn add angular-chartist.js chartist angular

Next

npm install angular-chartist.js@next chartist angular --save
yarn 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
import angular from 'angular';
import angularChartist from 'angular-chartist.js';

angular.module('app', [angularChartist]);

In your HTML, add the chartist directive to any div or make it a custom element:

<chartist class="ct-chart" chartist-data="chartist.barData" chartist-chart-type="Bar"></chartist>
AttributeTypeRequired
chartist-dataObjectYes
chartist-chart-typeStringYes
chartist-events*ObjectNo
chartist-chart-optionsObjectNo
chartist-responsive-optionsArrayNo

Format for Chartist events:

{
  event: function eventHandler(obj) {
    // 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:

$scope.chartOptions = {
  plugins: [
    Chartist.plugins.ctPointLabels({
      textAnchor: 'middle'
    })
  ]
};

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.

5.0.0-beta.2

6 years ago

5.0.0-beta.1

6 years ago

5.0.0-beta.0

6 years ago

4.3.4

7 years ago

4.3.3

7 years ago

4.3.2

7 years ago

4.3.1

7 years ago

4.3.0

7 years ago

4.2.3

7 years ago

4.2.2

7 years ago

4.2.1

8 years ago

4.2.0

8 years ago

4.2.0-beta.0

8 years ago

4.1.0-beta.1

8 years ago

4.1.0-beta.0

8 years ago

4.0.0-beta.2

8 years ago

4.0.0-beta.1

8 years ago

4.0.0-beta

8 years ago

3.3.13

8 years ago

3.3.12

8 years ago

3.3.11

8 years ago

3.3.10

8 years ago

3.3.9

9 years ago

3.3.6

9 years ago

3.3.5

9 years ago

3.3.4

9 years ago

3.3.3

9 years ago

3.3.0

9 years ago

3.2.0

9 years ago

3.1.1

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.3

9 years ago