1

Is there any simple example (preferibly with a JSFiddle) for an implementation of a full circle gauge with Highcharts like the one below from jQuery knob ?

enter image description here

Here is what I ve got so far : http://jsfiddle.net/skeletorkun/grn5o39e/1/

$(function () {

    var gaugeOptions = {

        chart: {
            type: 'solidgauge'
        },

        title: null,

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

        tooltip: {
            enabled: false
        },

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

        plotOptions: {
            solidgauge: {
                dataLabels: {
                    y: 5,
                    borderWidth: 0,
                    useHTML: true
                }
            }
        }
    };


    // The RPM gauge
    $('#container-rpm').highcharts(Highcharts.merge(gaugeOptions, {
        yAxis: {
            min: 0,
            max: 100,
            title: {
                text: 'sth'
            }
        },

        series: [{
            name: 'RPM',
            data: [92],
            dataLabels: {
                format: '<div style="text-align:center"><span style="font-size:25px;color:' +
                    ((Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black') + '">{y}</span><br/>'

            },
            tooltip: {
                valueSuffix: ' revolutions/min'
            }
        }]

    }));




});
Orkun
  • 6,998
  • 8
  • 56
  • 103

2 Answers2

6

You can realise that by solid-gauge and set a correct angles in pane.

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

Example: http://jsfiddle.net/e76o9otk/1/

Sebastian Bochan
  • 37,348
  • 3
  • 49
  • 75
1

Is jQuery roundSlider suitable for you ?

This was made with div elements only, so very easy to customize and flexible to use.

For more details check the demos page.

Demo on jsFiddle same as your requirement

Soundar
  • 2,569
  • 1
  • 16
  • 24