Team:Imperial/Resources/JS:charts

From 2014.igem.org

Revision as of 00:36, 17 October 2014 by HChughtai (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
       $(function () {
           $('#water_use_breakdown').highcharts({
               chart: {
                   plotBackgroundColor: null,
                   plotBorderWidth: 1, //null,
                   plotShadow: false
               },
               title: {
                   text: 'Water Consumption by Sector'
               },
               subtitle: {
                   text: 'Worldometers 2014'
               },
               tooltip: {
                   pointFormat: '{series.name}: {point.percentage:.1f}%'
               },
               plotOptions: {
                   pie: {
                       allowPointSelect: true,
                       cursor: 'pointer',
                       dataLabels: {
                           enabled: true,
                           format: '{point.name}: {point.percentage:.1f} %',
                           style: {
                               color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                           }
                       }
                   }
               },
               series: [{
                   type: 'pie',
                   name: 'Browser share',
                   data: [
               ['Agricultural irrigation', 67.0],
               ['Industrial', 11.0],
               
                       {
                           name: 'Domestic Use',
                           y: 22.0,
                           sliced: true,
                           selected: true
               },
                           ]
       }]
           });
       });