JustGage - 更改仪表的背景颜色

JustGage - change gauge's background color

我在 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,它会给我一个灰色背景的空管道:

我需要将此空管道的背景更改为红色,但前提是 countComplete 等于 0 且 countTotal 大于 0。在所有其他情况下,背景应保持灰色:

``

如果可以的话,你能告诉我怎么做吗?

已经想通了。要更改仪表线的背景,您只需在仪表主体中添加一个参数:

gaugeColor: "#ff0000"