Helper Routines for Google Graphs

Google calls them charts, rather than graphs.

I updated my xg_graphs.js javascript graphing library. Before, I had provided for easy svg manipulation. This time, I wanted to add simple bar (horizontal) and column (vertical) graphs. I realized that the graphs wouldn’t look that good. And I won’t mention that it was getting way too complicated. So, I started looking for alternatives. I ended up writing helper routines to make using Google Graphs more simple.

I hesitated to use Google Graphs, because I like to keep my footprint small – makes for faster loading and uses less energy. Yet, I knew that Google would keep things as light as they could. So, I went down that route and I like the results.

Using Google Graphs, you can create all sorts of graphs: annotation, area, bar, bubble, calendar, candlestick, column, combo, diff, donut, gantt, geo, gauge, histograms, interval, line, map (uses satellite images rather than line drawings as geo does), org, pie, sankey diagram, scatter, stepped area, table, timelines, tree map, trendlines, waterfall, and word trees. I only coded for the most popular types of graphs. I’ve never heard of some of these graph types.

Donut charts are Pie charts with a pie hole in the middle. Bar and Column charts are similar, the bars just go different ways – horizontal vs vertical. A Table is a sortable table as you may have seen somewhere on the web. Geo charts use maps to graph things – slightly similar to my svg graph routines.

You can read the documentation here. I kept it simple and generic, which meant there are limitations. Still, my routines will help you draw a nice looking graph, simply. I’ll be adding more functionality. And I’ll be posting about those improvements.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x