$(function () { var gaugeOptions = { chart: { type: 'solidgauge', backgroundColor: null }, title: null, pane: { center: ['50%', '100%'], size: '150%', startAngle: -90, endAngle: 90, background: { backgroundColor: '#333', innerRadius: '100%', outerRadius: '60%', borderWidth: '0', shape: 'arc' } }, tooltip: { enabled: false }, // the value axis yAxis: { stops: [ [0, '#219c31'], // green [2, '#219c31'], // yellow [4, '#ff6000'] // red ], lineWidth: 0, minorTickInterval: null, tickAmount: 5, title: { enabled: false }, labels: { y: -5 } }, plotOptions: { solidgauge: { dataLabels: { y: -100, borderWidth: 0, useHTML: true } } } }; // total_power_w $('#rpm').highcharts(Highcharts.merge(gaugeOptions, { yAxis: { min: 3000, max: 4800, }, credits: { enabled: false }, navigation: { buttonOptions: { enabled: false } }, series: [{ data: [0], dataLabels: { enabled: false }, }] })); // uptime_d setInterval(function refresh() { var chart = $('#rpm').highcharts(), point = chart.series[0].points[0], yAxis = chart.yAxis[0]; $.ajax({ url: './data/rpm.json', dataType: 'json', success: function(data) { val = data[0]; point.update(val); yAxis.update({ title: { text: false } }, false); chart.redraw(); }, cache: false }) return refresh; }(), 5000); });