Getting started

Dependencies

This repository contains a set of native AngularJS directives for Chart.js. The only required dependencies are:

AngularJS (requires at least 1.4.x)

Chart.js (requires Chart.js 2.x).

Files to download

The easiest is to download with npm:

npm install angular-chart.js --save

Alternatively files can be downloaded from Github or via PolarArea. See readme for more information.

Whichever method you choose the good news is that the overall size is very small: <5kb for all directives (~1kb with gzip compression!)

Installation

You need to include the dependencies in your page:

<script src="node_modules/chart.js/Chart.min.js"></script> <script src="node_modules/angular-chart.js/dist/angular-chart.min.js"></script>

As soon as you've got all the files downloaded and included in your page you just need to declare a dependency on the chart.js module:



angular.module('myModule', ['chart.js']);

CSS

Colors

Series have beautiful pre-sets colors (to a maximum of 7 series, after that colors will be randomly generated). They can be overwritten using Chart.defaults.global.colors .

Blue Light grey Red Green Yellow Grey Dark Grey

You can also use the provider : ChartJsProvider in a .config()