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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

1. Introducing FusionCharts > Time for action — Writing the HTML and JavaScript...

Time for action — Writing the HTML and JavaScript code to embed the chart

  1. Create an empty HTML file within the FirstChart folder named as FirstChart.html.
  2. Paste the following code in the file and save it:
    <html>
    <head>
    <title>My First chart using FusionCharts</title>
    <script type="text/javascript" src="../FusionCharts/FusionCharts.js">
    </script>
    </head>
    <body>
    <div id="chartContainer">FusionCharts will load here!</div>
    <script type="text/javascript">
    <!-- var myChart = new FusionCharts("../FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "1" );
    myChart.setXMLUrl("Data.xml");
    myChart.render("chartContainer");//-->
    </script>
    </body>
    </html>
    
  3. Open it in a web browser. You should see your first chart coming to life, as shown in the following screenshot. Refresh the browser to experience the animation again, or hover over the columns to see tooltips.
    Time for action — Writing the HTML and JavaScript code to embed the chart

  

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