set dial style for Gauge chart - Javascript highcharts

Javascript examples for highcharts:Gauge Chart

Description

set dial style for Gauge chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {/*from   w  w w.ja  v  a 2s .c  om*/
    $('#container').highcharts({
        chart: {
            type: 'gauge'
        },
        pane: {
            startAngle: -150,
            endAngle: 150
        },
        yAxis: {
            min: 0,
            max: 100
        },
        plotOptions: {
            gauge: {
                dial: { ////start editing
                    radius: '75%',
               backgroundColor: '#666666',
               borderWidth: 0,
               baseWidth: 7,
               topWidth: 1,
               baseLength: '90%', // of radius
               rearLength: '0%'
                },
                pivot: {
                    backgroundColor: '#666666',
                    radius: 3
                }////end editing
            }
        },
        series: [{
            data: [80]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/highcharts-more.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="width: 400px; height: 300px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials