make pie chart show 0 data - Javascript highcharts

Javascript examples for highcharts:Chart Data

Description

make pie chart show 0 data

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.src.js"></script> 
      <div id="container"></div> 
      <script type="text/javascript">
var chart = Highcharts.chart('container', {
  chart: {/*from w  w w .j  av  a2s .c  om*/
    type: 'pie'
  },
  series: [{
    data: [{
       y: 1,
      isZero: true
    }, {
       y: 1,
      isZero: true
    }, {
       y: 1,
      isZero: true
    }],
    tooltip: {
       pointFormatter: function() {
         return "<span style='color:" + this.color + "'>\u25CF</span>" + this.series.name + ": <b>" + (this.options.isZero ? 0 : this.y) + "</b><br/>";
      }
    }
  }]
});

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

Related Tutorials