Shading in between data series

12 views
Skip to first unread message

Benjamin Adams

unread,
Jun 20, 2011, 12:54:30 PM6/20/11
to Google Visualization API
Greetings,

I am trying to represent scientific data using the Visualization
API.
The needs for the web application are as follows:

1) The graphing utility should be interactive
2) The utility should work with major browsers
3) The utility should have the capability to display standard
deviation/error bars on a time series line plot.

The Visualization API passes the first two criteria with flying
colors, but the last point is rather problematic. It is, of course,
possible to create upper and lower data series for the standard
deviation, but it doesn't really achieve what I'm after in a visual
representation of the data. In the absence of built in support for
error bars, etc., is there any way to shade the chart background like
in the area chart, except instead of using the x axis as the bounds,
use another data series? (i.e. the upper and lower bounds of the
error) I didn't see any such thing like this listed on the API
documentation, but find it a desirable feature to add.

asgallant

unread,
Jun 20, 2011, 1:23:36 PM6/20/11
to google-visua...@googlegroups.com
You can kludge together something that vaguely resembles std dev or std err bars.  Add two columns to your dataTable, one representing the lower bound and one for the upper bound.  Build the chart as a combo chart, with type "line" for your data and type: "bars" for the bounds, set the isStacked option to true, and set the color of the lower bound column to match the background of your chart.  It is far from perfect, and I'm not certain it would even qualify as "good enough", but it sort-of works.

NA

unread,
Jun 20, 2011, 4:17:55 PM6/20/11
to Google Visualization API
I think there's a bug with the (undocumented) isStacked parameter.
The first time you hover over the chart, tooltips work fine. But the
tooltips are off for any subsequent interactions. I'm not sure if
other things might not work with isStacked:true.

Just a mild warning - make sure you test it out to make sure it will
be interactive enough (test any events you want to check for, etc).
Reply all
Reply to author
Forward
0 new messages