From b28028ac4082842143b0f528d6bc539da6ccb419 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 21 Sep 2017 12:49:18 -0400 Subject: mega changes, including updates and X --- www/lib/tc-angular-chartjs/README.md | 126 +++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 www/lib/tc-angular-chartjs/README.md (limited to 'www/lib/tc-angular-chartjs/README.md') diff --git a/www/lib/tc-angular-chartjs/README.md b/www/lib/tc-angular-chartjs/README.md new file mode 100644 index 00000000..74191e37 --- /dev/null +++ b/www/lib/tc-angular-chartjs/README.md @@ -0,0 +1,126 @@ +tc-angular-chartjs +================== + +[![Build Status](https://travis-ci.org/carlcraig/tc-angular-chartjs.svg)](https://travis-ci.org/carlcraig/tc-angular-chartjs) + +[Documentation](http://carlcraig.github.io/tc-angular-chartjs/) + +### Add Chart.js to your angular applications + +tc-angular-chartjs provides you with directives for all chartjs chart types. + +- Line Charts +- Bar Charts +- Radar Charts +- Polar Area Charts +- Pie Charts +- Doughnut Charts + +You can see all the [Chart.js Documentation](http://www.chartjs.org/docs/) on their website. + +Installation +============ + +Grab the latest version of `Chart.js` and `tc-angular-chartjs`. + +Load `Chart.js` and `tc-angular-chartjs` as you would with normal scripts. + +```html + + + +``` + +Make sure you use `dist/tc-angular-chartjs.js` or `dist/tc-angular-chartjs.min.js` + +Require `tc.chartjs` in your application modules where you require `Chart.js`. + +```javascript +angular.module( 'app', ['tc.chartjs']); +``` + +Basic Usage +=========== + +There are 6 different directives. + +- tc-chartjs +- tc-chartjs-line +- tc-chartjs-bar +- tc-chartjs-radar +- tc-chartjs-polararea +- tc-chartjs-pie +- tc-chartjs-doughnut + +Just place one of these directives on a `canvas` element to create a Chart.js chart. + +```html + +``` + +You will also want to give the chart some `data` and `options`. These can be provided +by assigning $scope variables to `chart-options` and `chart-data` attributes on the same canvas element. + +```html + +``` +```javascript +$scope.myData = [ + { value : 50, color : "#F7464A" }, + { value : 90, color : "#E2EAE9" }, + { value : 75, color : "#D4CCC5" }, + { value : 30, color : "#949FB1"} +]; + +$scope.myOptions = { + // Chart.js options can go here. +}; + +$scope.onChartClick = function (data, event) { + console.log(data, event); +}; + +``` + +Using the `tc-chartjs` directive +================================ + +When using the `tc-chartjs` directive you will need to add an additional attribute to +say which type of chart should be created. + +Just attach a `chart-type=""` attribute to the canvas element. + +```html + +``` + +Available Types: + +- line +- bar +- radar +- polararea +- pie +- doughnut + +Passing another value to chart-type than the above will try to create a chart of +that type, which is useful if you have extended Chart.js with custom chart types, +e.g. through plugins. + +Contributing +============ + +- [Open a Pull Request (PR)](https://github.com/carlcraig/tc-angular-chartjs/pull/new/master) +- Make sure your PR is on a new branch you created from the latest version of master branch +- Please do not open a PR from your master branch +- Open a PR even if your code is incomplete to start a discussion and to collect feedback +- Please make sure all unit tests pass, and add new tests for any added features. + + +License +======= + +tc-angular-chartjs is dual licensed with the Apache-2.0 or MIT license. + +See LICENSE-APACHE-2.0 and LICENSE-MIT for more details. + -- cgit v1.2.3