5 Replies Latest reply on Jul 8, 2008 2:43 PM by Fred_BR

    Problem with localization and Charts (pt_BR)

    Fred_BR
      Hello,

      I am having some troubles with localization and Charts. I have a serie that has a date and a value in the format: (2.000,00) where the dot (.) is the thousandsSeparator and the comma is the decimalSeparator. But at the vertical axis the values are in the format (2,000.00) (comma for de thousandsSeparator and dot for the decimalSeparator)

      I´ve tried to create framework resource properties for pt_BR and recompiling the project, but it didn't work. I know it is related to the framwork resource properties but I have no ideas for what I can do. One solution is to change the format of the series values, but I don't like this solution.
        • 1. Re: Problem with localization and Charts (pt_BR)
          Gregory Lafrance Level 6
          Just to confirm, you changed the thousands and decimal separator properties in both these files and recompiled?

          SharedResources.properties
          validators.properties

          Have you been able to verify your changed values are appearing somewhere?
          • 2. Problem with localization and Charts (pt_BR)
            Fred_BR Level 1
            hi Greg,

            yes, I've changed the thousands and decimal separator from both files and recompiled the aplication. I am verifing the changes with the DateChoose control. When I compile with the option -locale en_US the days and months are in english, and when I compile whith -locale pt_BR the days and months are in portuguese, just as I typed them.
            • 3. Re: Problem with localization and Charts (pt_BR)
              Developer504 Level 1
              Hi Fred,

              You asked me to look at this, I had a vaguely similar problem but I'm afraid I can't even quite fully follow what your issue is here. I created a custom function to put in a comma separator, as follows:

              <mx:NumberFormatter id="numForm" useThousandsSeparator="true"/>

              I then used this function for my chart as a labelFunction
              private function formatNumber(value:Object, prevValue:Object, axis:IAxis):String
              {return numForm.format(value).toString();
              }

              ...and that gave me my formatting. I don't know if that helps at all or if it's even related to your issue, but it's all I got :)
              • 4. Re: Problem with localization and Charts (pt_BR)
                Fred_BR Level 1
                Hello Developer504,

                Thanx for the help, I'll try that. My problem is that the series values, comes with a different format then the Vertical Axis. The result is that the chart becomes broken, because when there is a value of 1.000,00 (one thousand) it apears as 1.00 and when there is a value like 1,230 it apears as 1 thousand 2 hundred and 30.
                • 5. Re: Problem with localization and Charts (pt_BR)
                  Fred_BR Level 1
                  I figured out the solution:

                  I created a parseFunction for the VerticalAxis:

                  public function corrigeValor(value:String):Number{
                  var nb:NumberBase = new NumberBase(",",".",",",".");
                  return parseFloat(nb.parseNumberString(value));
                  }