You are viewing documentation for an older version. For current documentation - click here.

In some countries, commas are used as decimal separators and dots as thousand separators. But, if you directly specify such numbers in FusionWidgets XT XML, it will give an error while converting to number. FusionWidgets XT introduces a smart way to let you specify numbers in your own format in XML.

Consider the XML/JSON below (for a pyramid chart):

<chart caption="Sales distribution by Employee" subCaption="Jan 07 - Jul 07" numberPrefix="$" isSliced="1" inThousandSeparator="." inDecimalSeparator=",">
<set label="Buchanan" value="20.231,54"/>
<set label="Callahan" value="49.457,78"/>
<set label="Davolio" value="63.190,51"/>
<set label="Dodsworth" value="41.286,51"/>
<set label="Fuller" value="74.779,52"/>
<set label="King" value="49.890,21"/>
</chart>
{
  "chart": {
    "caption": "Sales distribution by Employee",
    "subcaption": "Jan 07 - Jul 07",
    "numberprefix": "$",
    "issliced": "1",
    "inthousandseparator": ".",
    "indecimalseparator": ","
  },
  "data": [
    {
      "label": "Buchanan",
      "value": "20.231,54"
    },
    {
      "label": "Callahan",
      "value": "49.457,78"
    },
    {
      "label": "Davolio",
      "value": "63.190,51"
    },
    {
      "label": "Dodsworth",
      "value": "41.286,51"
    },
    {
      "label": "Fuller",
      "value": "74.779,52"
    },
    {
      "label": "King",
      "value": "49.890,21"
    }
  ]
}

In this XML/JSON, we're providing the numbers in the non-standard convention - i.e., we've used dot as the thousand separator and comma as the decimal separator (as followed in some European countries). Now, to make sure that FusionWidgets XT reads these numbers in the right way, we convey our input decimal and thousand separator characters as under:

<chart ... inThousandSeparator='.' inDecimalSeparator=',' ..>

This tells FusionWidgets XT that it should treat dot in the input numbers as thousands (instead of normal decimals) and comma as decimals.

When you now view this chart, you'll get the following output:

 
You can see that FusionWidgets XT has interpreted the numbers properly and automatically converted the numbers into the standard format. If you want to output the numbers again in the non-conventional format, you can use the following XML:
 
<chart caption="Sales distribution by Employee" subCaption="Jan 07 - Jul 07" numberPrefix="$" isSliced="1" inThousandSeparator="." inDecimalSeparator="," thousandSeparator="." decimalSeparator="," formatNumberScale="0">
<set label="Buchanan" value="20.231,54"/>
<set label="Callahan" value="49.457,78"/>
<set label="Davolio" value="63.190,51"/>
<set label="Dodsworth" value="41.286,51"/>
<set label="Fuller" value="74.779,52"/>
<set label="King" value="49.890,21"/>
</chart>
{
  "chart": {
    "caption": "Sales distribution by Employee",
    "subcaption": "Jan 07 - Jul 07",
    "numberprefix": "$",
    "issliced": "1",
    "inthousandseparator": ".",
    "indecimalseparator": ",",
    "thousandseparator": ".",
    "decimalseparator": ",",
    "formatnumberscale": "0"
  },
  "data": [
    {
      "label": "Buchanan",
      "value": "20.231,54"
    },
    {
      "label": "Callahan",
      "value": "49.457,78"
    },
    {
      "label": "Davolio",
      "value": "63.190,51"
    },
    {
      "label": "Dodsworth",
      "value": "41.286,51"
    },
    {
      "label": "Fuller",
      "value": "74.779,52"
    },
    {
      "label": "King",
      "value": "49.890,21"
    }
  ]
}
 
You will get the following chart:
 
 
Notice how . is used for thousand separator and , for decimal separator.