|
FusionCharts v3 introduces the concept of number scaling. Number scaling lets you define the scale of plotted values. So, based on the nature of data, you can define an appropriate scale for your chart. And FusionCharts will scale the values accordingly. |
Basic Example |
FusionCharts applies default scale of K (thousand) and M (Million) to all values. So, depending on their magnitudes values will be scaled to thousand or million. For example, values 12500, 13400, and 13300, would be displayed as 12.5K, 13.4K, and 13.3K respectively. |
![]() |
Adding billions to default scaling |
The default scale is K, M (1000, 1000) scale. You can make it more extensive by adding billions to it. This would transform the scale to K, M, B (1000, 1000, 1000) scale. For human understanding the scale can be defined more explicitly in the following manner. 1000 = 1 K The following steps show how to incorporate the K, M, B scale in a chart:
|
A chart plotted using K, M, B scale would look similar to the one shown below. |
![]() |
Following is the XML for the above chart: |
<chart numberScaleValue='1000,1000,1000' numberScaleUnit='K,M,B' numberPrefix='$'> <set label='John' value='986000000' /> <set label='Mary' value='3134000000' /> <set label='Andy' value='3245000000' /> </chart> |
Another Example - Putting time in scale |
Let's consider another example where we configure a scale for plotting time related figures. Say we're plotting a chart, which indicates time taken to accomplish several automated processes. The time duration for accomplishment of processes may range from a few seconds to days. In this case, we will define the following time scale for the chart. 60 seconds = 1 minute Here are the steps for incorporating the scale in chart:
When you enter the data into XML, it must be provided in terms of the base scale unit or the default scale unit - which (in case of this example) is seconds. Hence, all values must be converted to seconds as shown below: 8 was converted to 38s Following is the XML for the time scale chart:
|
<chart defaultNumberScale='s' numberScaleValue='60,60,24,7' numberScaleUnit='min,hr,day,wk'> <set label='A' value='38' /> <set label='B' value='150' /> <set label='C' value='11050' /> <set label='D' value='334345' /> <set label='E' value='1334345' /> </chart> |
![]() |
Storage Size Example |
Take another example, where you're plotting a chart indicating memory usage of a network server. The usage can be from few bits to a few gigabytes. The scale is descibed below: 8 bits = 1 Byte And the XML can be written as under: <chart defaultNumberScale='bits' numberScaleValue='8,1024,1024,1024,1024' numberScaleUnit='bytes,KB,MB,GB,TB' > |
For this example the value needs to be provided in terms of bits as this is the base uint. |
Length/Distance Example |
Let's consider another length/distance example. 12 inches = 1 feet So, we can write the XML as under: |
For this example, values must be provided in terms of inches as it is the base unit of the scale. |