Make the pie chart 100% of the div - Javascript highcharts

Javascript examples for highcharts:Pie Chart

Description

Make the pie chart 100% of the div

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js"></script> 
      <style id="compiled-css" type="text/css">

div#container {/*w  w w . j  a v a2 s.c  om*/
   margin: 10px;
   width: 198px;
   height: 152px;
   border: 4px solid black;
}


      </style> 
      <script type="text/javascript">
$(function() {
   var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            margin: [0, 0, 0, 0],
            spacingTop: 0,
            spacingBottom: 0,
            spacingLeft: 0,
            spacingRight: 0
        },
        credits: {
            enabled: false
        },
        title: {
            text: null
        },
        plotOptions: {
            pie: {
                size:'100%',
                dataLabels: {
                    enabled: false
                }
            }
        },
        series: [{
            type: 'pie',
            name: 'Months',
            data: [
                ['Jan', 45.0],
                ['Feb', 26.8],
                ['Mar', 8.5],
                ['June', 6.2],
                ['July', 21.0]
            ]}]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/2.2.4/highcharts.js"></script> 
      <div id="container"></div>  
   </body>
</html>

Related Tutorials