Se è ancora aggiornato.
L'ho fatto con la libreria "Highcharts".
Code:
<div class="container" style="margin-top:50px">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Your score:</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div id="chart1" style="width:100%;height:250px;"> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script type="text/javascript" charset="utf-8">
Highcharts.chart('chart1', {
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: ''
},
pane: {
startAngle: -120,
endAngle: 120,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
// the value axis
yAxis: {
min: 0,
max: 200,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
title: {
text: 'Points'
},
plotBands: [{
from: 0,
to: 50,
color: '#DF5353' // red
}, {
from: 50,
to: 150,
color: '#DDDF0D' // yellow
}, {
from: 150,
to: 200,
color: '#55BF3B' // green
}]
},
series: [{
name: 'Points',
data: [{eqSum}]
}]
});
</script>