2017-07-18 182 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"