Created
March 17, 2016 20:22
-
-
Save JeffryGonzalez/7e938c3c110dfe96c3fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <title></title> | |
| <link href="//cdn.jsdelivr.net/angular.chartjs/latest/angular-chart.css" rel="stylesheet" /> | |
| </head> | |
| <body> | |
| <div ng-app="app"> | |
| <div ng-controller="ChartController as vm"> | |
| <canvas id="line" class="chart chart-line" chart-data="vm.data" chart-labels="vm.labels" | |
| chart-legend="true" chart-series="series" chart-click="vm.onClick"></canvas> | |
| <pre> | |
| {{vm | json}} | |
| </pre> | |
| </div> | |
| </div> | |
| <script src="Scripts/angular.min.js"></script> | |
| <script src="Scripts/Chart.min.js"></script> | |
| <script src="//cdn.jsdelivr.net/angular.chartjs/latest/angular-chart.min.js"></script> | |
| <script> | |
| var app = angular.module("app", ["chart.js"]); | |
| app.controller("ChartController", function () { | |
| var vm = this; | |
| vm.labels = ["January", "February", "March", "April", "May", "June", "July"]; | |
| vm.series = ['Series A', 'Series B']; | |
| vm.data = [ | |
| [65, 59, 80, 81, 56, 55, 40], | |
| [28, 48, 40, 19, 86, 27, 90] | |
| ]; | |
| vm.onClick = function() { | |
| console.log(arguments); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment