Solid Gauge chart Width - Javascript highcharts

Javascript examples for highcharts:Gauge Chart

Description

Solid Gauge chart Width

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://code.jquery.com/jquery-1.9.1.js"></script> 
      <style id="compiled-css" type="text/css">

body {//from w  w w  . j  a v a2 s  .  c  o  m
   background: lightblue;
}


      </style> 
      <script type="text/javascript">
    $(window).load(function(){
$(function () {
    $('#gauge').highcharts({
        chart: {
            type: 'solidgauge',
            backgroundColor: 'transparent'
        },
        title: null,
        pane: {
            center: ['50%', '70%'],
            size: '130%',
            startAngle: -90,
            endAngle: 90,
            background: {
                backgroundColor: '#fff',
                innerRadius: '75%',
                outerRadius: '100%',
                shape: 'arc',
                borderColor: 'transparent'
            }
        },
        tooltip: {
            enabled: false
        },
        // the value axis
        yAxis: {
            min: 0,
            max: 100,
            stops: [
                [0.1, '#e74c3c'], // red
                [0.5, '#f1c40f'], // yellow
                [0.9, '#2ecc71'] // green
                ],
            minorTickInterval: null,
            tickPixelInterval: 400,
            tickWidth: 0,
            gridLineWidth: 0,
            gridLineColor: 'transparent',
            labels: {
                enabled: false
            },
            title: {
                enabled: false
            }
        },
        credits: {
            enabled: false
        },
        plotOptions: {
            solidgauge: {
                innerRadius: '75%',
                dataLabels: {
                    y: -45,
                    borderWidth: 0,
                    useHTML: true
                }
            }
        },
        series: [{
            data: [83],
            dataLabels: {
                format: '<p style="text-align:center;">{y}%</p>'
            }
        }]
    });
});
    });

      </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/solid-gauge.src.js"></script> 
      <div id="gauge" style="height:142px;"></div>  
   </body>
</html>

Related Tutorials