Tutorials - Database - Page 3
The chart data is ready for downloading. Now we need to include the flash chart into
a web page.
Code:
<html>
<head>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "my_chart",
"550", "400", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/tutorial-db-3-1.php"} );
</script>
</head>
<body>
<h1>Hello world!</h1>
<div id="my_chart"></div>
</body>
</html>
You will need to change the code: {"data-file":"gallery/tutorial-db-3-1.php"} to
point at your JSON file "ofc-chart.php".
Save this HTML into a file (call "ofc.php") in the root of your webserver, you can test it
by browsing to the URL of the page ( http://example.com/ofc.php )
You should see the chart. If not, right click and view source to see that the javascript is ok.
View my version here.
OK, nearly done. The rest of this tutorial is cleaning up both the code and the chart: Tutorial 4
|
Adverts:
|