farklı durumlarda en üst ve değişim göstergesi rengini uyacak şekilde 2) farklı durumlarda manometereninkine rengini değiştirme ... Bu şimdiye kadar yaptığım ama çalışmıyor şudur:Ölçek SVG resmi kullanıyorum şu Raphael yapmaya çalışıyorum
archtype.customAttributes.counter = function (counter, top) {
var motto = '';
switch(true) {
case(counter<=(top/10)):
motto = 'Very Poor !'
colour = '#BD2727'; //pretty sure this is wrong
break;
case(counter<=(5.61*top/10)):
motto = 'Poor'
colour = '#F79A38'; //pretty sure this is wrong
break;
case(counter<=(7.21*top/10)):
motto = 'Fair'
colour = '#FBDE07'; //pretty sure this is wrong
break;
case(counter<=(8.81*top/10)):
motto = 'Good'
colour = '#90C342'; //pretty sure this is wrong
break;
case(counter<=(9.61*top/10)):
motto = 'Excellent'
colour = '#1F9C4C'; //pretty sure this is wrong
break;
}
return {
counter: [counter,top],
text: Math.floor(counter) + '\n' + motto
}
}
Fiddle burada: http://jsfiddle.net/mwvLc0kb/4/