Include Chart.js and tc-angular-chartjs in bootstrap skin

This commit is contained in:
Kyle Johnson 2014-11-25 15:23:06 +00:00
parent 7faace32b9
commit 7dff223aa6
2 changed files with 9 additions and 1 deletions

View File

@ -30,6 +30,7 @@ function xhtmlHeaders( $file, $title )
$bootstrapCssFile = getSkinFile( 'css/bootstrap.css' ); $bootstrapCssFile = getSkinFile( 'css/bootstrap.css' );
$bootstrapJsFile = getSkinFile( 'js/bootstrap.min.js' ); $bootstrapJsFile = getSkinFile( 'js/bootstrap.min.js' );
$ChartJsFile = getSkinFile( 'js/Chart.min.js' ); $ChartJsFile = getSkinFile( 'js/Chart.min.js' );
$tcangularchartjsFile = getSkinFile( 'js/tc-angular-chartjs.min.js' );
$basename = basename( $file, '.php' ); $basename = basename( $file, '.php' );
$viewCssFile = getSkinFile( 'views/css/'.$basename.'.css' ); $viewCssFile = getSkinFile( 'views/css/'.$basename.'.css' );
$viewCssPhpFile = getSkinFile( 'views/css/'.$basename.'.css.php' ); $viewCssPhpFile = getSkinFile( 'views/css/'.$basename.'.css.php' );
@ -73,11 +74,12 @@ function xhtmlHeaders( $file, $title )
} }
?> ?>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script type="text/javascript" src="<?= $ChartJsFile ?>"></script>
<script src="<?= getSkinFile('js/app.js'); ?>"></script> <script src="<?= getSkinFile('js/app.js'); ?>"></script>
<script src="<?= getSkinFile('js/controllers.js'); ?>"></script> <script src="<?= getSkinFile('js/controllers.js'); ?>"></script>
<script type="text/javascript" src="<?= $tcangularchartjsFile ?>"></script>
<script type="text/javascript" src="<?= $jqueryJsFile ?>"></script> <script type="text/javascript" src="<?= $jqueryJsFile ?>"></script>
<script type="text/javascript" src="<?= $bootstrapJsFile ?>"></script> <script type="text/javascript" src="<?= $bootstrapJsFile ?>"></script>
<script type="text/javascript" src="<?= $ChartJsFile ?>"></script>
<script type="text/javascript" src="tools/mootools/mootools-core.js"></script> <script type="text/javascript" src="tools/mootools/mootools-core.js"></script>
<script type="text/javascript" src="tools/mootools/mootools-more.js"></script> <script type="text/javascript" src="tools/mootools/mootools-more.js"></script>
<script type="text/javascript" src="js/mootools.ext.js"></script> <script type="text/javascript" src="js/mootools.ext.js"></script>

View File

@ -0,0 +1,6 @@
/**
* tc-angular-chartjs - v1.0.9 - 2014-10-14
* Copyright (c) 2014 Carl Craig <carlcraig@3c-studios.com>
* Dual licensed with the Apache-2.0 or MIT license.
*/
!function(){"use strict";function a(a){return new a}function b(a){return new a("line")}function c(a){return new a("bar")}function d(a){return new a("radar")}function e(a){return new a("polararea")}function f(a){return new a("pie")}function g(a){return new a("doughnut")}function h(){return function(a){function b(b,d,e){var f,g=d[0].getContext("2d"),h=new Chart(g),i=!1,j=!1,k=!1,l=null;for(var m in e)"chartLegend"===m?i=!0:"chart"===m?k=!0:"autoLegend"===m&&(j=!0);b.$watch("data",function(e){if(e){if(f&&f.destroy(),a)f=h[c(a)](b.data,b.options);else{if(!b.type)throw"Error creating chart: Chart type required.";f=h[c(b.type)](b.data,b.options)}i&&(b.legend=f.generateLegend()),j&&(l&&l.remove(),angular.element(d[0]).after(f.generateLegend()),l=angular.element(d[0]).next()),k&&(b.chart=f)}},!0)}function c(a){var b=a.toLowerCase();switch(b){case"line":return"Line";case"bar":return"Bar";case"radar":return"Radar";case"polararea":return"PolarArea";case"pie":return"Pie";case"doughnut":return"Doughnut";default:return a}}var d={restrict:"A",scope:{data:"=chartData",options:"=chartOptions",type:"@chartType",legend:"=chartLegend",chart:"=chart"},link:b};return d}}function i(){function a(a,b){a.$watch("legend",function(a){a&&b.html(a)},!0)}var b={restrict:"A",scope:{legend:"=chartLegend"},link:a};return b}angular.module("tc.chartjs",[]).directive("tcChartjs",a).directive("tcChartjsLine",b).directive("tcChartjsBar",c).directive("tcChartjsRadar",d).directive("tcChartjsPolararea",e).directive("tcChartjsPie",f).directive("tcChartjsDoughnut",g).directive("tcChartjsLegend",i).factory("TcChartjsFactory",h),a.$inject=["TcChartjsFactory"],b.$inject=["TcChartjsFactory"],c.$inject=["TcChartjsFactory"],d.$inject=["TcChartjsFactory"],e.$inject=["TcChartjsFactory"],f.$inject=["TcChartjsFactory"],g.$inject=["TcChartjsFactory"]}();