Code coverage report for src/charts/donut/examples/donut-chart.js

Statements: 100% (0 / 0)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (0 / 0)      Ignored: none     

All files » src/charts/donut/examples/ » donut-chart.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94                                                                                                                                                                                           
/**
 * @ngdoc directive
 * @name patternfly.charts.component:pfDonutChart
 * @restrict E
 *
 * @description
 *   Component for rendering a donut chart which shows the relationships of a set of values to a whole.  When using a
 *   Donut Chart to show the relationship of a set of values to a whole, there should be no more than six
 *   categories.
 *
 *   <br><br>
 *   See http://c3js.org/reference.html for a full list of C3 chart options.
 *
 * @param {object} config configuration properties for the donut chart:<br/>
 * <ul style='list-style-type: none'>
 * <li>.chartId        - the unique id of the donut chart
 * <li>.centerLabelFn  - user defined function to customize the text of the center label (optional)
 * <li>.onClickFn(d,i) - user defined function to handle when donut arc is clicked upon.
 * </ul>
 *
 * @param {object} data an array of values for the donut chart.<br/>
 * <ul style='list-style-type: none'>
 * <li>.key           - string representing an arc within the donut chart
 * <li>.value         - number representing the value of the arc
 * </ul>
 *
 * @param {number} chartHeight height of the donut chart
 
 * @example
 <example module="patternfly.charts">
   <file name="index.html">
     <div ng-controller="ChartCtrl">
       <div class="container-fluid">
         <div class="row">
           <div class="col-md-6 text-center">
             <label>Donut Chart</label>
           </div>
           <div class="col-md-6 text-center">
             <label>Small Donut Chart</label>
           </div>
         </div>
       </div>
       <div class="row">
         <div class="col-md-6 text-center">
           <pf-donut-chart config="config" data="data"></pf-donut-chart>
         </div>
         <div class="col-md-6 text-center">
           <pf-donut-chart config="custConfig" data="data" chart-height="chartHeight"></pf-donut-chart>
         </div>
       </div>
      </div>
     </div>
   </file>
 
   <file name="script.js">
     angular.module( 'patternfly.charts' ).controller( 'ChartCtrl', function( $scope, $interval ) {
       $scope.config = {
         'chartId': 'chartOne',
         'legend': {"show":true},
         'colors' : {
           'Cats': '#0088ce',     // blue
           'Hamsters': '#3f9c35', // green
           'Fish': '#ec7a08',     // orange
           'Dogs': '#cc0000'      // red
         },
         donut: {
           title: "Animals"
         },
         'onClickFn': function (d, i) {
           alert("You clicked on donut arc: " + d.id);
          }
       };
 
       $scope.custConfig = angular.copy($scope.config);
       $scope.custConfig.chartId = 'chartTwo';
       $scope.custConfig.legend.position = 'right';
       $scope.custConfig.centerLabelFn = function () {
         return "Pets";
       };
       $scope.chartHeight = 120;
 
       $scope.data = [
         ['Cats', 2],
         ['Hamsters', 1],
         ['Fish', 3],
         ['Dogs', 2]
       ];
 
 
     });
   </file>
 </example>
 */