2017-07-18 187 views
1

我在我的ASP頁面上使用了justgage.1.0.1.js。我已經配置了進度線顏色爲4個扇區是這樣的:JustGage - 更改標尺的背景顏色

var g1 = new JustGage({ 
    id: "gauge1", 
    value: 0, 
    min: 0, 
    max: 100, 
    title: "Some Title", 
    showMinMax: 0, 
    label: '0 of 2', 
    levelColorsGradient: false, 
    countComplete: 0, 
    countTotal: 2, 
    levelColors: [ "#ff0000", "#ff9900", "#ffcc00", "#cccc00" ] 
}); 

而如果countComplete = 0它鬆獅我空管帶有灰色背景色:

enter image description here

我需要將此空管的背景更改爲紅色,但前提是countComplete等於0且countTotal大於0.在所有其他情況下,背景應保持灰色:

`enter image description here enter image description here enter image description here

如果這是可以做到的,你能告訴我怎麼做嗎?

回答

0

已經想通了。要改變量規線的背景,您只需將一個參數添加到量表的主體:

gaugeColor: "#ff0000"