Menu

Switching languages

Help
Markus
2007-01-09
2013-01-13
  • Markus

    Markus - 2007-01-09

    Hello,

    is it possible to change the language used for displaying the axis
    legends via the Ce Wolf tags?

    Currently it seems that especially the number formats (decimal and thousands
    separator) are taken from the OS language i.e. if I run Tomcat on a german
    Windows computer I get a "," as a decimal separator and on the Unix
    machine, that runs an english AIX version I get a ".".

    I need to control this behaviour at runtime so I can change it depending on
    the user who is displaying the actual chart.

    The lang option in the img tag doesn't seem to work. Is there a chance
    to set the desired lang option via the CeWolf tag?

    Thank you
    Markus

     
    • Rinke Hoekstra

      Rinke Hoekstra - 2007-01-10

      In fact, this is more a question for a JFreeChart forum, or for the postprocessor forum of cewolf, because you will need both.

      You need to use a postprocessor. In this, you will need to get a reference to your axis. For example:

      ValueAxis rangeAxis = myPlot.getRangeAxis();
      if (rangeAxis instanceof NumberAxis) {
         NumberAxis axis = (NumberAxis) rangeAxis;
         axis.setNumberFormatOverride(NumberFormat formatter);
      }

      With this method you can pass a NumberFormatter to your axis. See: http://www.jfree.org/jfreechart/api/gjdoc/index.html

       

Log in to post a comment.