Specifies an item of locale information to be used when parsing string values in the following methods SetSeriesValuesFromString, SetSeriesXValuesFromString, SetSeriesYValuesFromString, SetCategoriesFromString and SetDataFromTxtFile.

void object.SetLocaleInfo( int type, String data )

Arguments

object
Required. A Chart object.
type
Required. An integer value which specifies the type of locale information to be set by the method (see table below).
data
Required. A string value containing the locale information the method will set.

Remarks

By default, the SetSeriesValuesFromString, SetSeriesXValuesFromString, SetSeriesYValuesFromString, SetCategoriesFromString and SetDataFromTxtFile methods use the items of locale information provided by the System. Locale information depend on the language of the System.

The type of locale information is defined by an integer value (the type parameter) which is interpreted as follows:

Code Definition
1
Locale Decimal Separator
2
Locale Thousand Separator

Example

Let us consider 2 different strings:

String values_str_1= "1.234,5;1.678,5";
String values_str_2= "1234.5;1678.5";

And let us pretend that the regional settings on the system are:
    "," as decimal separator
    "." as thousand separator


  1. Then the 2 strings will be interpreted as:

    values_str_1
      first value:  1234.5 (correct)
      second value: 1678.5 (correct)
    values_str_2
      first value:  12345  (wrong)
      second value: 16785  (wrong)

  2. However, by calling the method SetLocaleInfo ...
    chart.SetLocaleInfo( 1, "." ); // Decimal separator
    chart.SetLocaleInfo( 2, " " ); // Thousand separator
    
    ... the 2 previous strings will be interpreted as:
    values_str_1
      first value:  1.2345  (wrong)
      second value: 1.6785  (wrong)
    values_str_2
      first value:  1234.5 (correct)
      second value: 1678.5 (correct)

  3. JSP Sample Code

    The following JSP code illustrates use of the SetLocaleInfo method.

    // Let's set the categories of a chart object with a ";"-delimited string
    String decimal_separator= ",";
    String thousand_separator= ".";
    
    // Before setting the series and categories, we must specify the locale info
    // so that Swiff Chart Generator will correctly interpret the strings
    chart.SetLocaleInfo( 1, decimal_separator );
    chart.SetLocaleInfo( 2, thousand_separator );
    
    String the_categories= "North America" + sep + "South America" + sep + "Europe" + sep + "Middle East" + sep + "Asia";
    chart.SetCategoriesFromString( the_categories );
    
    String the_values= "1.890,23" + sep + "970,56" + sep + "1590,91" + sep + "576,85" + sep + "376,35";
    chart.SetSeriesValuesFromString( 0, the_values );
    

    See Also

    SetSeriesValuesFromString Method | SetSeriesXValuesFromString Method | SetSeriesYValuesFromString Method | SetCategoriesFromString Method | SetDataFromTxtFile Method

    Applies To: Chart Object