Pie No Ledgend

by Rich P

HTML

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="pieContainer" style="height: 400px"></div>

JavaScript

$(function() {

  var myChart = Highcharts.chart('pieContainer', {

    credits: {
      enabled: false
    },

    title: {
      text: ''
    },

    legend: {
      labelFormatter: function() {
        return this.rowData.name;
      }
    },

    tooltip: {
      followPointer: true,
      hideDelay: 100,
      //pointFormat: 'Facilities: {point.y:,.1f} <br>{point.percentage:.1f}%'
      formatter: function() {
        return '<b>' + this.point.name + ':</b><br/> ' + this.y.toLocaleString() + ' Facilities <br/>' + this.percentage.toFixed(1) + ' %';
      }
    },

    plotOptions: {
      pie: {
        "data": [{
          "y": 6708,
          "name": "Targeted",
          "sliced": false,
          "selected": false,
          "color": "#FF5733",
          "showInLegend": true
        }, {
          "y": 24622,
          "name": "Non-Targeted",
          "sliced": true,
          "selected": true,
          "color": "#D4D3D2",
          "showInLegend": true
        }, {
          "y": 4057,
          "name": "Participating",
          "sliced": false,
          "selected": false,
          "color": "#3EA457",
          "showInLegend": true
        }]
      }
    },

    series: [{
      type: 'pie',
      name: 'Outside Name',
      dataLabels: {
        enabled: true,
        connectorWidth: 1,
        distance: 25,
        style: {
          color: "contrast",
          fontSize: "11px",
          textOutline: "none", //"1px contrast",
        },
        formatter: function() {
          return this.point.name + ':<br/> ' + this.percentage.toFixed(1) + ' %';
        }
      }
    }]
  });
});