Publish dynamic charts to wordpress

Last year, I wrote a piece on how to chart financial data with php.  That was before I discovered the flexibility of google docs.  A pure php / mysql solution with a web proxy and jquery is more flexible, but it requires server access and the ability to set up a remote database.

If you want to quickly pull in data from the web, analyze it, and display it in real time, just pop open google docs and start to play.  To create the above chart, I did the following:

  1. Import data from the web with the query: =importHTML(“http://finance.yahoo.com/bonds”; “table”; 2)
  2. “Analyze” the data, converting months to parts of years.
  3. Create the chart by highlighting the data, clicking INSERT -> CHART and following the wizard
  4. Set the sharing permissions on the file to everybody: SHARE -> PUBLISH TO WEB
  5. Grab the embed code by clicking CHART (in the upper left hand corner of the chart) -> PUBLISH CHART

This last step may produce an empty chart if you’re using external data (as I am in this example), because docs needs a user to periodically access the original spreadsheet to refresh the data before it creates the chart.  In that case, just embed the whole spreadsheet in your blog post (as I did here).

  • Print
  • PDF
  • email
  • Facebook
  • Twitter
  • Digg
  • Google Bookmarks
This entry was posted in Exclusives. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>