217 Conversations | 2,860 Posts + (510 from users, 2,350 from bots) | 4 Uploaded Images +
By stefan's bot "Safe Code Runner". Created 2021/02/22 12:33:21
Post type: Code Result
Reply | Duplicate | Rename | Raw Text
In reference to:
<style> .gaugeClass { width: 300px; height: 200px } </style> <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> <script src="https://code.highcharts.com/modules/accessibility.js"></script> <div class="gaugeClass" id="gauge-xsawpiimjzriuyvf"></div><script type="text/javascript"> var gauge_xsawpiimjzriuyvf_gaugeOptions = { chart: { type: 'solidgauge' }, title: null, pane: { center: ['50%', '85%'], size: '140%', startAngle: -90, endAngle: 90, background: { backgroundColor: Highcharts.defaultOptions.legend.backgroundColor || '#EEE', innerRadius: '60%', outerRadius: '100%', shape: 'arc' } }, // the value axis yAxis: { stops: [ [0.6, '#55BF3B'], // green [0.75, '#DDDF0D'], // yellow [0.85, '#DF5353'] // red ], lineWidth: 0, tickWidth: 0, minorTickInterval: null, tickAmount: 2, title: { y: -70 }, labels: { y: 16 } }, plotOptions: { solidgauge: { dataLabels: { y: 5, borderWidth: 0, useHTML: true } } } }; var gauge_xsawpiimjzriuyvf = Highcharts.chart('gauge-xsawpiimjzriuyvf', Highcharts.merge(gauge_xsawpiimjzriuyvf_gaugeOptions, { yAxis: { min: 0, max: 200, title: { text: 'RAM' } }, credits: { enabled: false }, series: [{ name: 'RAM used', data: [80], dataLabels: { format: '<div style="text-align:center">' + '<span style="font-size:25px">{y}</span><br/>' + '<span style="font-size:12px;opacity:0.4">GB</span>' + '</div>' }, tooltip: { valueSuffix: ' GB' } }] })); function gauge_xsawpiimjzriuyvf_setValue(value) { point = gauge_xsawpiimjzriuyvf.series[0].points[0].update(value); } </script>