textIndicatorPrecision in dojox.dgauges using dojo

纵饮孤独 提交于 2019-12-12 18:01:21

问题


What is the name of the attribute in Dgauges to add a precision, it was textIndicatorPrecision in dojox.gauges, like noChange it's replaced by interactionArea.

I added an indicator to my circular gauge using dojox.dgauges but I want to add a precision.

Code :

  var indicatorText = new dojox.dgauges.TextIndicator(); 
  indicatorText.set("indicator",indicator); 
  indicatorText.set("x", 130); 
  indicatorText.set("y", 154); 
  gauge.addElement("indicatorText", indicatorText); 

Thank you.


回答1:


There is no replacement for this property. You must define your own labelFunc. Example:

var textIndicator = new TextIndicator();
... 
textIndicator.labelFunc = function(v){
    return v.toFixed(2);
}


来源:https://stackoverflow.com/questions/15791408/textindicatorprecision-in-dojox-dgauges-using-dojo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!