Highcharts Demo

author(s): Torstein Hønsi

by Jens Kühn

HTML

<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.js"></script>

<div style="width: 600px; height: 400px; margin: 0 auto">
  <div id="container-speed" style="width: 300px; height: 200px; float: left"></div>
  <div id="container-rpm" style="width: 300px; height: 200px; float: left"></div>
</div>

CSS

.highcharts-yaxis-grid .highcharts-grid-line {
  display: none;
}

JavaScript

var gaugeOptions = {

  chart: {
    type: 'solidgauge',
    plotBackgroundColor: null,
    plotBackgroundImage: null,
    plotBorderWidth: 0,
    plotShadow: false
  },
title: {
        text: ''
    },
  pane: {
    center: ['50%', '85%'],
    size: '140%',
    startAngle: -90,
    endAngle: 90,
    background: {
      backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE',
      innerRadius: '60%',
      outerRadius: '100%',
      shape: 'arc'
    }
  }
};

// The speed gauge
var chartSpeed = Highcharts.chart('container-speed', Highcharts.merge(gaugeOptions, {
  yAxis: {
    min: 0,
    max: 100,
    labels: {
      distance: 15,
       step: 2
    },
    
    tickWidth: 0,
    tickColor: '#666',
    
    plotBands: [{
        from: 0,
        to: 49.999,
        color: '#55BF3B', // green
        thickness: '40%'
      }, {
         from: 50,
         to: 99,
         color: '#DDDF0D', // yellow
        thickness: '40%'
      }, {
         from: 99,
         to: 100,
         color: '#DF5353', // red
        thickness: '40%'
      }]
  },

  series: [{
    data: [20]
  }]

}));