|
how to retrieve data from mysql table to draw a chart |
Posted by Gopal on Jun-07-2011 14:02 |
|
hello ,
i want to modify the the sample bar chart using my own data. i.e i want to retrieve the
date from date fields , i have startdate and enddate fields in my assigned table . i am
calculate the difference between the dates and display this in y-axis of barchart.
thanks in advance |
Re: how to retrieve data from mysql table to draw a chart |
Posted by Peter Kwan on Jun-08-2011 01:10 |
|
Hi Gopal,
To read data from MySQL, you may refer to the PHP/MySQL documentation for details. Basically, you can send an SQL query to the MySQL server and read the data back. After you have read the data in PHP array variables, you may pass them to ChartDirector to create a chart.
There are some examples in the ChartDirector documentation in the section "Using Data Sources with ChartDirector". You may use them as references.
For obtaining the difference between the dates, please refer to MySQL documentation for details (eg. see the DateDiff function in MySQL).
Hope this can help.
Regards
Peter Kwan |
|