custom styling for pie chart - Javascript highcharts

Javascript examples for highcharts:Pie Chart

Description

custom styling for pie chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div> 
      <script type="text/javascript">
Highcharts.chart('container', {
  chart: {// w w  w  . j  av  a 2s  . c o m
    type: 'pie'
  },
  plotOptions: {
    pie: {
      dataLabels: {
        distance: -20,
      },
    }
  },
  series: [{
    colorByPoint: true,
    borderWidth: 0,
    innerSize: '30%',
    size: '120%',
    dataLabels: {
      enabled: false,
    },
    data: [{
      name: 'one',
      y: 56.33,
      color: 'rgba(0,0,0,0)'
    }, {
      name: 'two',
      y: 24.03,
      color: 'rgba(0,0,0,0)'
    }, {
      name: 'three',
      y: 10.38,
      color: 'rgba(0,0,0,0)'
    }, {
      name: 'four',
      y: 24.77
    }, {
      name: 'five',
      y: 10.91,
      color: 'rgba(0,0,0,0)'
    }, {
      name: 'six',
      y: 10.2,
      color: 'rgba(0,0,0,0)'
    }]
  }, {
    colorByPoint: true,
    borderWidth: 0,
    innerSize: '30%',
    size: '80%',
    data: [{
      name: 'one',
      y: 56.33
    }, {
      name: 'two',
      y: 24.03,
    }, {
      name: 'three',
      y: 10.38
    }, {
      name: 'four',
      y: 24.77
    }, {
      name: 'five',
      y: 10.91
    }, {
      name: 'six',
      y: 10.2
    }]
  }]
});

      </script>  
   </body>
</html>

Related Tutorials