$(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, '#248824'], // green [400, '#416c80'], // yellow [800, '#a13939'] // red ], lineWidth: 0, minorTickInterval: null, tickAmount: 4, title: { enabled: false }, labels: { y: -5 } }, plotOptions: { solidgauge: { dataLabels: { y: -100, borderWidth: 0, useHTML: true } } } }; // total_power_w $('#redstar_total_power_w').highcharts(Highcharts.merge(gaugeOptions, { yAxis: { min: 0, max: 1200, }, credits: { enabled: false }, navigation: { buttonOptions: { enabled: false } }, series: [{ data: [0], dataLabels: { enabled: false }, }] })); // uptime_d setInterval(function refresh() { var chart = $('#redstar_total_power_w').highcharts(), point = chart.series[0].points[0], yAxis = chart.yAxis[0]; $.ajax({ url: './data/redstar_total_power.json', dataType: 'json', success: function(data) { val = data[0]; point.update(val); yAxis.update({ title: { text: false } }, false); chart.redraw(); }, cache: false }) return refresh; }(), 15000); });