[RGRAPH SUPPORT] How can I create a chart from data in an HTML table?

How can I create a chart from data in an HTML table?

Post a reply
Posted by Erwan at 10:17 on 11th September 2021
Hello,
I have a table in html which is created every day, how can I add your library to create graphs from this table?
Do you have an example?

Regards

Posted by Richard at 12:27 on 11th September 2021
There isn't any function in RGraph that parse an HTML table and extracts data from it.

Th import tools are:

Google Sheets: https://www.rgraph.net/canvas/sheets.html
     CSV data: https://www.rgraph.net/canvas/csv.html
AJAX functions: https://www.rgraph.net/canvas/ajax.html

These get data and then provide it to you as a JavaScript array which you can then give to your chart object.

If you can get hold of the data before it's turned into HTML that would be best.

But if you can't, a function that parses HTML tables would be a good thing for RGraph to have so let me know and I'll make one. I'm not sure if colspans and rowspans would be feasible so it may just be a basic table parser.

Regardless, let me know and I'll make something that parses a table. Ideally give me a sample of your table too.

Posted by Erwan at 14:10 on 11th September 2021
There is an example on the site: https://www.highcharts.com/demo/column-parsed
and I already have a model but I am limited on the type of chart.
I would like to make donut and pie charts
Do you have an email for an attachment?

cordially

Posted by Richard at 22:28 on 15th September 2021
For anyone who's interested - there's now a HTML table import utility that resulted from this that allows you to import data from a table that's on the page.

It will be available from version 6.03 which I'm aiming to release at the start of November.

There's a blog article that shows you some source code here:

https://www.rgraph.net/blog/index-2021.html#a-new-html-table-import-utility-for-version-6-03

Post a reply

What's your name?
What do you want to say?