Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. Customizing your Chart > Time for action — setting up a number scale to unde...

Time for action — setting up a number scale to understand billions as well

Time for action — setting up a number scale to understand billions as well Create a copy of ChartBackground.html and ChartBackground.xml, and rename them to CustomNumScale.html and CustomNumScale.xml respectively.Add the attributes numberScaleValue='1000,1000,1000' numberScaleUnit='K,M,B' to the<chart> element.Add three zeroes to each of the three revenue figures so that the new number scale consisting of billions can kick in. What just happened? We just created a number scale to convert all the numbers in the chart to K, M, and B. Here's how the conversion works in simpler terms: 1000 = 1K 1000 K=1M 1000 M=1B The same has been explained to the chart using numberScaleValue='1000,1000,1000' numberScaleUnit='K,M,B'. Essentially, what it means for the chart is, convert any number on the scale of 1000 to K, any number on the scale of 1000x1000 to M (the next value in numberScaleUnit), and any number on the scale of 1000x1000x1000 to B (the last value in numberScaleUnit). The only thing is that, as all the numbers on the chart are in the tune of billions, you don't get to see numbers in K and M. If Harry's revenue for 2009 and 2010 were 14875 and 2100600 respectively, the same number scale would have converted them to 14.88K and 2.1M respectively. Have a go hero — create a number scale to convert seconds to minutes, hours, and days The number scale we created in the previous example was more an extension of the default scale FusionCharts Suite already has. The real use of the custom number scale is when you need to define your own scales and the data in the chart varies pretty widely to actually need the different units defined in the scale. For example, in a chart plotting memory usage of a network server, it is very helpful to convert input data in bits to more easily understandable bytes, KBs, MBs, GBs, TBs, and more. Or in a chart plotting average support response time of different companies which is what you would be building here. The input data will be in seconds and you need to convert that to minutes, hours, and days. The numbers should look similar to the following table:



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint