// part of data to input
var traceGauge = {
type: 'pie',
showlegend: false,
hole: 0.4,
rotation: 90,
values: [ 81/9, 81/9, 81/9, 81/9, 81/9, 81/9, 81/9, 81/9, 81/9, 81],
text: ['0-1','1-2','2-3','3-4','4-5','5-6','6-7','7-8','8-9'],
direction: 'clockwise',
textinfo: 'text',
textposition: 'inside',
marker: {
colors: ['','','','','','','','','','white'],
labels: ['0-1','1-2','2-3','3-4','4-5','5-6','6-7','7-8','8-9'],
hoverinfo: 'label'
}
}
// needle
var degrees = 50, radius = .9
var radians = degrees * Math.PI / 180
var x = -1 * radius * Math.cos(radians) * wfreqNum
var y = radius * Math.sin(radians)
var gaugeLayout = {
shapes: [{
type: 'line',
x0: 0.5,
y0: 0.5,
x1: 0.6,
y1: 0.6,
line: {
color: 'black',
width: 3
}
}],
title: 'Chart',
xaxis: {visible: false, range: [-1, 1]},
yaxis: {visible: false, range: [-1, 1]}
}
var dataGauge = [traceGauge]
Plotly.plot('gauge', dataGauge, gaugeLayout)