Solution 1 :

ft needs a json, you must write a file from php type json

like this
…..

 $result = json_encode($dataIngGast, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE |JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT);
         //echo $result;
         
         $arquivo = "column-line-combination-data-gasto-ingreso-finanzas.json";
         $fp = fopen($arquivo, "a+");
         fwrite($fp, $result);
         
fclose($fp);

Problem :

I am a beginner at all things coding but need some help with Fusion Charts if anyone can help.

I have followed along with tutorials already for Fusion Charts linking it to MySQL database and displaying a chart with no issues.

However, I would like to display a time-series chart, which uses FusionTime. This requires the data to be in a Datatable. ” FusionTime accepts data in rows and columns as a Datatable”.

I cannot find any examples online for taking SQL data and converting into a datatable with data and schema which it seems to require. This is different from the way fusioncharts works.

https://www.fusioncharts.com/dev/fusiontime/getting-started/create-your-first-chart-in-fusiontime

My SQL database contains many tables and many columns within it, so will need to select the appropriate column to display.

I would appreciate any advice anyone can provide. The main problem is I don’t know how to get the SQL database into a data and schema file to display with fusiontime. This is to display on a webpage hosted locally.

Many thanks for any time you can provide to help with this

Comments

Comment posted by Chris Satchell

Could you provide a few more details, like the table structure, what the schema should look like, any code you’ve written, etc.?

Comment posted by Dip686

FusionTime takes data in an Array of array format. No matter what your database is, you need to generate the data in an array of array format. Mostly all the UI libraries follows the same standard. Write a script that can generate your sql data to the expected format in a file.

Comment posted by fusioncharts.com/dev/fusiontime/getting-started/…

Thanks for your reply Chris. Here is a link to the tutorial to create a time-series using the data and schema:

Comment posted by CJU

Thank you Dip686. I will try and research how to do this

Comment posted by Zapdos13

@CJU Which server-side technology are you using? is it java?

By