JustGage - 更改仪表的背景颜色

时间:2017-07-18 16:56:36

标签: html colors background gauge

我在ASP页面上使用justgage.1.0.1.js。我已将进度线的颜色配置为4个扇区,如下所示:

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

如果可以这样做,你能告诉我怎么做吗?

1 个答案:

答案 0 :(得分:0)

已经弄明白了。要更改仪表线的背景,您只需要在仪表的主体上添加一个参数:

gaugeColor: "#ff0000"
相关问题