Search icon
Subscription
0
Cart icon
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
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

Table of Contents (16) Chapters

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 — replace simple events with the advanced event model


For a pure academic purpose, we would replace our previously used FC_Rendered simple event with its counterpart in the advanced event model.

  1. 1. Create a copy of SimpleEvents.html in the JavaScriptCapabilities folder and name it as AdvancedEvents.html.

  2. 2. Open this file in a text editor and replace the entire FC_Rendered function block (line number 17 through 22) with the following lines of code:

    function showChartControls() {
    document.getElementById("chartControls")
    .style.display = "block";
    }
    myChart.addEventListener("rendered", showChartControls);
    
  3. 3. Open this file in your browser and you should see that the chart controls' placeholder text shows up in a similar fashion to the earlier simple event model.

What just happened?

Instead of declaring functions with the exact same name as the event name, we created a very straightforward function, showChartControls, which does behave exactly as named! Then we called the addEventListener...

lock icon The rest of the chapter is locked
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}