actionscript 3 - Formatting the datatip numbers from a Flex Barchart -


i don't know how this. code have.

public function doformatmoneda(valor:number):string{                 var formatomoneda:currencyformatter = new currencyformatter();                 formatomoneda.precision = "2";                 formatomoneda.rounding = "none";                  formatomoneda.decimalseparatorto = ".";                  formatomoneda.thousandsseparatorto = ",";                  formatomoneda.usethousandsseparator = "true";                  formatomoneda.usenegativesign = "true";                 formatomoneda.currencysymbol = "$";                 formatomoneda.alignsymbol = "left";                  return formatomoneda.format(valor.tostring());             }  private function formatcurrency(hitdata:hitdata):string{             var format:string = doformatmoneda(number(hitdata));             return format;                   }   <mx:barchart top="30" left="10" width="100%" dataprovider="{orgdata}" datatipfunction="formatcurrency" showdatatips="true" height="430" fontweight="bold" id="bccfds">                     <mx:verticalaxis>                         <mx:categoryaxis categoryfield="mes"/>                     </mx:verticalaxis>                 <mx:series>                     <mx:barseries                          yfield="mes"                          xfield="totalcancelada"                          labelfield="totalcanceladaformato"                         displayname="canceladas"                         barwidthratio="1.0"/>                     <mx:barseries                          yfield="mes"                          xfield="totalpagada"                          labelfield="totalpagadaformato"                         displayname="pagadas"                         barwidthratio="1.0"/>                     <mx:barseries                          yfield="mes"                          xfield="totalterminada"                          labelfield="totalterminadaformato"                         displayname="terminadas"                         barwidthratio="1.0"/>                 </mx:series>             </mx:barchart>               <mx:legend dataprovider="{bccfds}" direction="horizontal" /> 

it displays empty datatips. it's driving me nuts.

i think need value of currency hitdata , convert number. should try number(hitdata.item) or property of item has currencyvalue.


Comments