My Gauge是使用插件" gauge.js" http://bernii.github.io/gauge.js/ http://jsfiddle.net/aYqPT/42/
var opts2 = {
lines: 1, // The number of lines to draw
angle: 0, // The length of each line
lineWidth: 0.15, // The line thickness
pointer: {
length: 0.9, // The radius of the inner circle
strokeWidth: 0.042, // The rotation offset
color: '#000000' // Fill color
},
colorStart: '#6b6b6b', // Colors
colorStop: '#E0E0E0', // just experiment with them
strokeColor: '#EEEEEE', // to see which ones work best for you
generateGradient: true
};
var target2 = document.getElementById('gauge2'); // your canvas element
var gauge2 = new Gauge(target2).setOptions(opts2); // create gauge!
gauge2.maxValue = 3000; // set max gauge value
gauge2.animationSpeed = 32; // set animation speed (32 is default value)
//gauge2.set(700); // set actual value
function getValue() {
gauge2.set(1900);
}
setInterval(getValue, 2000);
要求仪表平滑地从先前值更改为下一个值。 如何正确改变价值?例如,as http://jsfiddle.net/gliljas/gsmAL/
谢谢!