2015-01-09 3 views
0

실제로 gauge.js를 사용하고 있습니다. 그것은 올바르게 작동하지만 캔버스의 맨 아래에 범례 값을 추가하고 싶습니다. 필자의 예에서는 단지 41 % 만 보여주고 싶다. 이 부분을 달성하는 방법을 알고 계십니까? http://jsfiddle.net/mopaetxp/Gauge.js를 사용하여 값을 추가하는 방법

<canvas id="foo"></canvas> 

var opts = { 
lines: 12, // The number of lines to draw 
angle: 0, // The length of each line 
lineWidth: 0.1, // The line thickness 
pointer: { 
length: 0.9, // The radius of the inner circle 
strokeWidth: 0.035, // The rotation offset 
color: '#000000' // Fill color 
}, 
limitMax: 'false', // If true, the pointer will not go past the end of the gauge 
colorStart: '#006EAB', // Colors 
colorStop: '#006EAB', // just experiment with them 
strokeColor: '#FFFFFF', // to see which ones work best for you 
generateGradient: true 
}; 
var target = document.getElementById('foo'); // your canvas element 
var gauge = new Donut(target).setOptions(opts); // create sexy gauge! 
gauge.maxValue = 100; // set max gauge value 
gauge.animationSpeed = 10; // set animation speed (32 is default value) 
gauge.set(41); // set actual value 

고마워 : 여기

는 jsfiddle입니다.

답변

0

를 사용하여 HTML LABEL Tag.check 데모 here

+0

감사합니다. 자바 스크립트로 숫자를 공제하는 것이 가능하다고 생각하십니까? –

+1

http://jsfiddle.net/pradyumnaswain/mopaetxp/2/를 확인하십시오. 레이블 값은 게이지 값으로 설정됩니다. 가치를 공제하고 싶다면 자바 스크립트에서 그 값을 사용할 수 있습니다. –

관련 문제