Gauge chart dial style - Javascript highcharts

Javascript examples for highcharts:Gauge Chart

Description

Gauge chart dial style

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  . j  a  v a2  s  .c  o m*/
    $('#container').highcharts({
        chart: {
            type: 'gauge'
        },
        pane: {
           startAngle: -90,
            endAngle: 90,
           background: null,
            center: ['50%', '50%'],
            size: 200
        },
       yAxis: {
            min: 0,
            max: 90,
            minorTickInterval: null,
            minorTickWidth: 1,
            minorTickLength: 10,
            minorTickPosition: 'inside',
            minorTickColor: '#666',
            tickPixelInterval: null,
            tickWidth: 2,
            tickPosition: 'inside',
            tickLength: 10,
            tickColor: '#666',
            labels: {
                step: 2,
                rotation: 'auto'
            },
            title: {
                text: 'km/h'
            },
            plotBands: [{
                from: 0,
                to: 30,
                color: '#55BF3B' // green
            }, {
                from: 30,
                to: 60,
                color: '#DDDF0D' // yellow
            }, {
                from: 60,
                to: 90,
                color: '#DF5353' // red
            }]
        },
        plotOptions: {
            gauge: {
                dial: { ////start editing
                    radius: '75%',
               backgroundColor: '#666666',
               borderWidth: 0,
               baseWidth: 20,
               topWidth: 1,
               baseLength: '10%', // of radius
               rearLength: '0%'
                },
                pivot: {
                    backgroundColor: '#666666',
                    radius: 10
                }////end editing
            }
        },
        series: [{
            data: [30]
        }]
    });
});

      </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