textIndicatorPrecision in dojox.dgauges using dojo

2019-07-18 16:47发布

问题:

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);
}