1 Reply Latest reply on Apr 27, 2009 7:12 AM by Gregory Lafrance

    Decimal Point data for Stacked Column Chart

    Sen Imagines Level 1

      Hi,

       

      I use a basic version of a Column chart for one of my projects. I use a stacked column chart with 2 data series namely "Expenses" & "Profit".

      I use decimal point numbers (with only two or three places after the decimal point) for both series.

       

      When I mouse over the bars of the output for tool tip, I view more numbers after the decimal point for some data.

      How to fix the decimal point to only 2 places & what is the reason for this behaviour?

       

      Attached is the sample output (output.gif) showing the above condition for the mentioned data.

       

      -Sen

       

       

       

       

        • 1. Re: Decimal Point data for Stacked Column Chart
          Gregory Lafrance Level 6

          Create an toolTipShow event handler and use a NumberFormatter to set the precision of the numbers (sample code from LiveDocs):

           

          <?xml version="1.0"?>
          <!-- formatters\MainNumberFormatter.mxml -->
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

              <mx:Script>
                  <![CDATA[
                      // Define variable to hold the number.       
                      [Bindable]
                      private var bigNumber:Number = 6000000000.65;
                  ]]>
              </mx:Script>

              <!-- Declare and define parameters for the NumberFormatter.-->
              <mx:NumberFormatter id="PrepForDisplay"
                  precision="0"
                  rounding="up"
                  decimalSeparatorTo="."
                  thousandsSeparatorTo=","
                  useThousandsSeparator="true"
                  useNegativeSign="true"/>

              <!-- Trigger the formatter while populating a string with data.-->
              <mx:TextInput text="{PrepForDisplay.format(bigNumber)}"/> 
          </mx:Application>