KendoUI测量最大值

时间:2013-02-12 08:37:34

标签: kendo-ui gauge

如果输入字段的值高于指针数,我如何为指针设置Kendo UI Radial Gauge动态最大值:

<input id="gauge-value" value="180">

$(".gauge").kendoRadialGauge({
                        pointer: {
                            value: $("#gauge-value").val(),
                            color: "#000"
                        },
                        scale: {
                        minorUnit: 5,
                        startAngle: -30,
                        endAngle: 210,
                        max: 100
                    }
                    });

1 个答案:

答案 0 :(得分:2)

max定义为表达式。

示例:如果您希望它为100或value,如果它超过100,请使用:

$(".gauge").kendoRadialGauge({
    pointer: {
        value: $("#gauge-value").val(),
        color: "#000"
    },
    scale  : {
        minorUnit : 5,
        startAngle: -30,
        endAngle  : 210,
        max       : Math.max(100, $("#gauge-value").val())
    }
});