FusionCharts for FileMaker offers us a lot of options to format our numbers on the chart. From number prefixes and suffixes to controlling the decimal places, FusionCharts for FileMaker lets us do it all. In this section, we'll see the how we can specify number formatting parameters. Majority of the number formatting properties are to be specified in the chartParms attribute.
 
Controlling decimal precision

Using decimals parameter we can globally set the number of decimal places for ALL NUMBERS on the chart, e.g. if we have values 12.438, 13.4 and 14 in our chart and we set decimals=2; the values will be displayed as 12.44, 13.4 and 14.

 
Before setting decimal parameter
After setting decimal parameter
 
Here is the complete FCQS of the chart.
?v=3
&chart=[chartType=Column2D;chartWidth=350;chartHeight=240]
&chartParams=[yAxisMinValue=12;yAxisMaxValue=15;adjustDiv=0;numDivLines=4;decimals=2]
&labels=Jeff;Mary;Shirley
&data=12.438;13.4;14
 
Adding number prefix and suffix

FusionCharts for FileMaker allows us to add a prefix or suffix to all numbers on the chart. We can use the following chartParams parameters/properties to attain the same:

  • numberPrefix=$ : Using this parameter, we could add prefix to all the numbers visible on the graph. For example, to represent all dollars figure on the chart, we could specify this parameter to '$' to show like $40000, $50000.
  • numberSuffix="/a" : Using this parameter, we could add suffix to all the numbers visible on the graph. For example, to represent all figure quantified as per annum on the chart, we could specify this parameter to'/a' to show like 40000/a, 50000/a.
 
Below is an example using numberPrefix followed by the chart generated using it:
?v=3
&chart=[chartType=Column2D;chartWidth=300;chartHeight=240]
&chartParams=[yAxisMinValue=12;yAxisMaxValue=15;adjustDiv=0;
numDivLines=4;decimals=2;numberPrefix=$]
&labels=Jeff;Mary;Shirley
&data=12.438;13.4;14
 
 
Now, let's add a suffix :
?v=3
&chart=[chartType=Column2D;chartWidth=300;chartHeight=240]
&chartParams=[yAxisMinValue=12;yAxisMaxValue=15;adjustDiv=0;
numDivLines=4; decimals=2;numberPrefix=$;numberSuffix=/a]
&labels=Jeff;Mary;Shirley
&data=12.438;13.4;14
 
 
For Combination Charts
 
Combination Chart uses two Y-Axes. Hence numberPrefix and numberSuffix parameters do not work for Combination Charts. We have to use sNumberPrefix and sNumberSuffix parameters for Secondary Y-Axis. Consider the FCQS below:
 
?chart=[chartType=column3dlinedy;chartWidth=350;chartHeight=280]
&chartParams=[caption=Sales Comparison;xAxisName=Weeks;showvalues=0;
numberPrefix=$;numberSuffix=/a;sNumberPrefix=T;sNumberSuffix=U]
&labels=Week 1;Week 2;Week 3;Week 4
&data=[seriesName=Current Month;numberPrefix=$]40800;31400;26700;55400
&data=[seriesName=Previous Month;numberPrefix=$]38300;28400;15700;48100
&data=[SeriesName=Qunatity;parentYaxis=s]400;300;300;500
 
 
If we intend to use special characters for numberPrefix or numberSuffix, we'll need to URL Encode them. For example, if we wish to have numberSuffix as % (like 30%), we'll need to specify it as under: numberSuffix='%2525'. For more on use of special characters, please refer to Advancedww Charting > Using Special Charaters page.
 
Automatic Number Formatting
FusionCharts automatically formats your numbers by adding K,M (Kilo, Million) and proper commas to the numbers. Shown below is an example:
 
 
We used &data=12500;13400;13000 here and FusionCharts converted the values to 12.5K, 13.4K and 13K respectively. Now, if you want to show the full figure, put formatNumberScale=0 in chartParams attribute.
 
?v=3
&chart=[chartType=Column2D;chartWidth=300;chartHeight=240]
&chartParams=[yAxisMinValue=12000;yAxisMaxValue=14000;formatNumberScale=0]
&labels=Jeff;Mary;Shirley
&data=12500;13400;13000
 
And here is the output:
 
 
Please note that in this chart all the numbers are displayed in comma-separated fashion. Use formatNumber=0 to remove comma (,).
 
?v=3
&chart=[chartType=Column2D;chartWidth=300;chartHeight=240]
&chartParams=[yAxisMinValue=12000;yAxisMaxValue=14000;
formatNumberScale=0;formatNumber=0]
&labels=Jeff;Mary;Shirley
&data=12500;13400;13000
 
 
Setting Custom Decimal Separator and Thousand Separator
FusionCharts Pro for FileMaker uses dot (.) as Decimal Separator and comma (,) as Thousand Separator. However, we can assign new characters as Decimal Separator and Thousand Separator. Consider the FCQS below:
 
?v=3
&chart=[chartType=Column2D;chartWidth=300;chartHeight=240]
&chartParams=[yAxisMinValue=12000;yAxisMaxValue=14000;formatNumberScale=0;
decimalSeparator=,;thousandSeparator=.]
&labels=Jeff;Mary;Shirley
&data=12500.56;13400.42;13000.81
 
Default Separators
After setting Separators