How to shade a portion of a line chart?

2,637 views
Skip to first unread message

B7

unread,
Dec 12, 2011, 12:01:54 PM12/12/11
to Google Visualization API
Hi,

I have a line chart with values of 50 to 300. How can I change the
background to green for the area between 100 to 200, to show a
"normal" value? This would represent the "normal" range of values.

Thank you.

asgallant

unread,
Dec 12, 2011, 12:18:55 PM12/12/11
to google-visua...@googlegroups.com
There is nothing in the API that allows for something like this.  You could try to hack the chart's SVG to get a green background for part of the chart, but this would not be easy.  As an alternative, you could use the new 'scope' column role (see http://code.google.com/apis/chart/interactive/docs/roles.html#whatrolesavailable) to define which points are in scope (100-200) versus those which are out of scope (<100, >200).  The chart draws out of scope points grey, with grey lines connecting consecutive out of scope points.

B7

unread,
Dec 12, 2011, 12:55:40 PM12/12/11
to Google Visualization API
Oh, I see. Thank you. That is very helpful.

On Dec 12, 9:18 am, asgallant <drew_gall...@abtassoc.com> wrote:
> There is nothing in the API that allows for something like this.  You could
> try to hack the chart's SVG to get a green background for part of the
> chart, but this would not be easy.  As an alternative, you could use the

> new 'scope' column role (seehttp://code.google.com/apis/chart/interactive/docs/roles.html#whatrol...) to

Reply all
Reply to author
Forward
0 new messages