gpt4 book ai didi

javascript - 使用 dojo 在 Classic Circular Linear Gauge 中显示当前值

转载 作者:太空宇宙 更新时间:2023-11-04 00:03:09 25 4
gpt4 key购买 nike

是否可以在 classic circular linear gauge 中显示当前值?就像在 default circular linear gauge

谢谢。

最佳答案

将 test_Classic_CircularLinearGauge.html 中的脚本标记更改为:

<script type="text/javascript">
require(["dojo/_base/kernel","dojo/parser","dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojox/dgauges/components/classic/CircularLinearGauge"]);
</script>

收件人:

<script type="text/javascript">
require(["dojo/_base/kernel","dojo/parser","dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojox/dgauges/components/classic/CircularLinearGauge"]);

// ADD THE CURRENT VALUE TO INDICATOR
require(["dojo/ready","dijit","dojox/dgauges/TextIndicator"],function(
ready,dijit,TextIndicator){
ready(function(){
var gauge=dijit.registry.byId("g1"); // ADAPT THIS TO YOUR GAUGE ID
indicator=gauge._elementsIndex.scale._indicators[0];
var indicatorText=new TextIndicator();
indicatorText.set("indicator",indicator);
indicatorText.set("x",80);
indicatorText.set("y",150);
gauge.addElement("indicatorText",indicatorText);
});
});
</script>

有点脏,很难。更好的方法是从 CircularLinearGauge 创建您自己的类并在构造函数中添加 TextIndicator...

关于javascript - 使用 dojo 在 Classic Circular Linear Gauge 中显示当前值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15772452/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com