我试图让我的仪表按扇区显示颜色(即在 var g1 上,我想要绿色 0-10、橙色 11-22 和红色 23-34)。
可以选择这样做,但是对于像我这样的菜鸟没有明确的说明。
任何帮助,将不胜感激。
<script>
var g1 = new JustGage({
id: "score",
value: <?php
print $content['field_anger_score'][0]['#markup'];
?>,
min: 0,
max: 34,
title: "Your Anger Score",
levelColorsGradient: false
});
var g2 = new JustGage({
id: "passive-aggressive",
value: <?php
print $content['field_passive_aggressive_score'][0]['#markup'];
?>,
min: 0,
max: 14,
title: "Passive Aggressive"
});
var g3 = new JustGage({
id: "aggressive",
value: <?php
print $content['field_aggressive_score'][0]['#markup'];
?>,
min: 0,
max: 6,
title: "Aggressive"
});
var g4 = new JustGage({
id: "assertive",
value: <?php
print $content['field_assertive_score'][0]['#markup'];
?>,
min: 0,
max: 4,
title: "Assertive"
});
</script>
东风