Highcharts Demo

author(s): Torstein Hønsi

by hakan

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 id="container" style="width: 600px; height: 400px; margin: 0 auto"></div>

JavaScript

// The speed gauge
Highcharts.chart('container', {

    chart: {
        type: 'solidgauge'
    },

    credits: {
        enabled: false
    },

    title: {
        text: 'Speed'
    },

    subtitle: {
        text: 'Individual point radius in Highcharts'
    },

    pane: {
        center: ['50%', '85%'],
        size: '100%',
        startAngle: -90,
        endAngle: 90,
        background: {
            backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE',
            innerRadius: '70%',
            outerRadius: '100%',
            shape: 'arc'
        }
    },

    // the value axis
    yAxis: {
        stops: [
            [0.1, '#55BF3B'], // green
            [0.5, '#DDDF0D'], // yellow
            [0.9, '#DF5353'] // red
        ],
        lineWidth: 0,
        minorTickInterval: null,
        min: 0,
        max: 100,
        tickPixelInterval: 400,
        tickWidth: 0,
        labels: {
            y: 16
        }
    },

    series: [{
        name: 'Speed',
        data: [{
            name: 'First car',
            radius: 80,
            innerRadius: 70,
            y: 5
        }, {
            name: 'Second car',
            radius: 90,
            innerRadius: 80,
            y: 60
        }, {
            name: '3 car',
            radius: 100,
            innerRadius: 90,
            y: 12
        }],
        dataLabels: {
            enabled: false
        },
        tooltip: {
            pointFormat: '{point.name}: <b>{point.y}</b> km/h'
        }
    }]
});