majorTicksColor通过使用dojo工具箱的间隔进入dojox仪表 [英] majorTicksColor by interval into dojox gauges using dojo toolkit

查看:143
本文介绍了majorTicksColor通过使用dojo工具箱的间隔进入dojox仪表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用dojo工具包和这个

I'm trying to use dojo toolkit and exactly this gauge.

事实上,我想要一个featureTicksColor和minorTicksColor的功能,我想颜色取决于间隔,例如:从0到

In fact, I want a feature to majorTicksColor and minorTicksColor, I want the color depends for the interval, eg : from 0 to 30 green, from 30 to 70 yellow and from 70 red to 100, or maybe it is degraded.

像这样 image

有可能吗?

谢谢。

回答:

推荐答案

像这样的小提琴

principal这里是使用一个方面来增强 drawRange 方法,

The principal here is to use an aspect to enhance the drawRange method of the dojox/gauges/GlossyCircularGauge widget.

//
// Use the new "drawGreenYellowRedCurves" as an *after* aspect to the existing "drawRange" function.
//
require(['dojox/gauges/GlossyCircularGauge', 'dojo/aspect', 'drawGreenYellowRedCurves', 'dojo/domReady!'],
  function (GlossyCircularGauge, aspect, drawGreenYellowRedCurves) {
    var gauge = new GlossyCircularGauge({
        background: [255, 255, 255, 0],
        title: 'Value',
        id: "glossyGauge",
        width: 300,
        height: 300
    }, dojo.byId("CircularGauge"));
    aspect.after(gauge, "drawRange", drawGreenYellowRedCurves, true);
    gauge.startup();
});

这篇关于majorTicksColor通过使用dojo工具箱的间隔进入dojox仪表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆