Solid gauge
author(s): Torstein Hønsi
by Rambabu Pudi
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>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<div id="container" class="container"></div>
CSS
.highcharts-figure .chart-container {
width: 300px;
height: 200px;
float: left;
}
.highcharts-figure, .highcharts-data-table table {
width: 600px;
margin: 0 auto;
}
.highcharts-data-table table {
font-family: Verdana, sans-serif;
border-collapse: collapse;
border: 1px solid #EBEBEB;
margin: 10px auto;
text-align: center;
width: 100%;
max-width: 500px;
}
.highcharts-data-table caption {
padding: 1em 0;
font-size: 1.2em;
color: #555;
}
.highcharts-data-table th {
font-weight: 600;
padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
background: #f8f8f8;
}
.highcharts-data-table tr:hover {
background: #f1f7ff;
}
@media (max-width: 600px) {
.highcharts-figure, .highcharts-data-table table {
width: 100%;
}
.highcharts-figure .chart-container {
width: 300px;
float: none;
margin: 0 auto;
}
}
JavaScript
Highcharts.chart('container', {
chart:{type:"solidgauge"},
"pane":{"startAngle":0,"endAngle":360,"background":[{"outerRadius":"100%","innerRadius":"83.33333333333333%","backgroundColor":"rgba(0,122,180,0.3)","borderWidth":0},{"outerRadius":"82.33333333333333%","innerRadius":"65.66666666666666%","backgroundColor":"rgba(201,10,90,0.3)","borderWidth":0},{"outerRadius":"64.66666666666666%","innerRadius":"47.999999999999986%","backgroundColor":"rgba(150,29,156,0.3)","borderWidth":0},{"outerRadius":"46.999999999999986%","innerRadius":"30.333333333333318%","backgroundColor":"rgba(232,86,0,0.3)","borderWidth":0}]},"yAxis":{"min":0,"lineWidth":0,"tickPositions":[]},"plotOptions":{"solidgauge":{"dataLabels":{"enabled":false},"linecap":"round","stickyTracking":false,"rounded":true}},"series":[{"name":"1-JAN-20","data":[{"color":"#007AB4","radius":"100%","innerRadius":"83.33333333333333%","y":46.01}]},{"name":"1-APR-20","data":[{"color":"#C90A5A","radius":"82.33333333333333%","innerRadius":"65.66666666666666%","y":47.36}]},{"name":"1-JUL-20","data":[{"color":"#961D9C","radius":"64.66666666666666%","innerRadius":"47.999999999999986%","y":45.27}]},{"name":"1-OCT-20","data":[{"color":"#E85600","radius":"46.999999999999986%","innerRadius":"30.333333333333318%","y":48.55}]}]
});