Get data from the database.A simple example where we query the database for some values, then display the results in the graph. Add this to your PHP: Create the flash object
<?php As I don’t have any data tables in my database, I have created an SQL query that generates some sin() values to display. You would replace the SQL query in the example with one that queries your database like normal. I have also hidden my connection details in a seperate include file (see the comments for details.) data-3.php
<?php
To see the data produced : data-3.php, then ‘view source’.
If you are interested in what the SQL command looks like, try pasting in an ‘echo $sql;’ into the code, then browse to that page to see it (because the SQL has been inserted into the data the Open Flash Chart will not render this data file, so take out the echo command to view the data as a chart.) |
Info: Open Flash Chart 2 is out. Version 1.x and these pages will never disappear and the charts will continue working forever, but further development on 1.x has stopped. Take a look at version 2 here Open Flash Chart 2.