Generate data from Mysql Table

I have a Project data in MySQL table in the following format.

Task Name | Task ID | Parrent Task ID | Start Date | End Date | Progress

What is the best approach to load the data from mysql table and generate charts on the run. Should it be done directly from database or first dump the table in xml format and then load xml?

Is there any sample for doing this?

The best way is to dump it as XML. No sample yet.