Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
FusionCharts Beginner's Guide: The Official Guide for FusionCharts Suite

You're reading from  FusionCharts Beginner's Guide: The Official Guide for FusionCharts Suite

Product type Book
Published in Apr 2012
Publisher Packt
ISBN-13 9781849691765
Pages 252 pages
Edition 1st Edition
Languages
Toc

Table of Contents (16) Chapters close

FusionCharts
Credits
About the Authors
About the Reviewer
www.PacktPub.com
1. Preface
1. Introducing FusionCharts 2. Customizing your Chart 3. JavaScript Capabilities 4. Enabling Drill-down on Charts 5. Exporting Charts 6. Integrating with Server-side Scripts 7. Creating Maps for your Applications 8. Selecting the Right Visualization for your Data 9. Increasing the Usability of your Charts Pop quiz Answers

Time for action — the chart showing the actual versus the projected revenue


  1. 1. Create a copy of MultiSeriesChart.html in the same folder and name it as ActualVsProjected.html.

  2. 2. Change the reference of the chart SWF file in the embedding code to MSCombi2D.swf. This SWF renders a 2D combination chart with a single y-axis.

  3. 3. Change the XML URL to ActualVsProjected.xml in the chart embedding code.

  4. 4. Create an XML file with the name ActualVsProjected.xml in the same folder and write the following data in it:

    <chart caption='Harry&apos;s SuperMart' subcaption='Revenue by Year' xAxisName='Year' yAxisName='Amount' numberPrefix='$'>
    <categories>
    <category label='2009' />
    <category label='2010' />
    <category label='2011' />
    </categories>
    <dataset seriesName='Actual Revenue'>
    <set value='1487500' />
    <set value='2100600' />
    <set value='2445400' />
    </dataset>
    <dataset seriesName='Projected Revenue' renderAs='Line' dashed='1' showValues='0' color='666666'>
    <set value='1216500' />
    <set value='2043400' />
    <set value='2292400' />
    </dataset>
    </chart>
    
  5. 5. Open ActualVsProjected.html in your browser. You should see a chart similar to the following screenshot:

What just happened?

We just created a combination chart to compare the actual revenue of Harry's SuperMart to the projected revenues, which were set as a target. For a change, we have plotted it as a 2D chart using MSCombi2D.swf. The XML data is similar in structure to the multi-series chart. The three years that form the x-axis labels are provided as<category> elements. There are two data series in the chart, one representing the actual revenue, and the other, projected revenue. There are a few new attributes that we have added to the<dataset> element of the data series representing the projected revenue, as the following line of code:

<dataset seriesName='Projected Revenue' renderAs='Line' dashed='1' showValues='0' color='666666'>

The first attribute renderAs='Line' instructs FusionCharts to render this series as a line series. The other possible values are Column and Area for this chart. As this line in the chart reflects guidance of revenues, we have visually indicated this by plotting it as a dashed line using the attribute dashed='1'. Thereafter, we have turned off the display of the data values for this series using showValues='0' to avoid cluttering of too many data values. Finally, we have provided a custom color for this series using color='666666'.

Simple, isn't it? Let us now build the second type of combination chart, to compare the revenues versus units of products sold.

You have been reading a chapter from
FusionCharts Beginner's Guide: The Official Guide for FusionCharts Suite
Published in: Apr 2012 Publisher: Packt ISBN-13: 9781849691765
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}