Rendering a Google Chart based on a html table

392 views
Skip to first unread message

SuneR

unread,
Aug 10, 2011, 10:59:18 AM8/10/11
to Google Visualization API
Hi,

Forgive my probably stupid question, I am quite new to google charts
and the Google Visualization API.

I am wondering if it is possible to render a piechart based on a html
table - or do I have to build the data in javascript?

/Sune

Roni Biran

unread,
Aug 10, 2011, 12:04:11 PM8/10/11
to google-visua...@googlegroups.com
I don't think so. You'll have to transform the table into JSON data table. It's not that complicated. You can go over the table as an XML element, or just go over the rows (as children of the table main element)


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

asgallant

unread,
Aug 10, 2011, 12:05:16 PM8/10/11
to google-visua...@googlegroups.com
There is no explicit support for this.  I think there is a javascript module that someone wrote that does this (Google it), or you could use tools like jQuery to parse your table for data, but the general consensus is that it's better to get the data from the original source rather than pull it from HTML.

Valerii

unread,
Apr 13, 2012, 6:34:31 PM4/13/12
to google-visua...@googlegroups.com
Hi,
Look at gvChart it's a plugin for jQuery, that uses Google Charts to create interactive visualization by using data from the HTML table tag.

asgallant

unread,
Apr 16, 2012, 9:24:09 AM4/16/12
to google-visua...@googlegroups.com
The gvChart plugin is horrendously out of date, I would be rather surprised if anything in it worked properly any more.
Reply all
Reply to author
Forward
0 new messages