Google Visualization: Area Chart Configuration Options Do not work

129 views
Skip to first unread message

Nicholas Newlands

unread,
Feb 15, 2012, 8:39:52 AM2/15/12
to google-visua...@googlegroups.com
This is my second thread about this because i cant actually find my other thread despite searching very hard for it.

So as far as i can see, any 'Configuration Options' with a '.' in it does not work ie.

var options = { 'width': 410, 'height': 260,
 'areaOpacity': 1,
 'backgroundColor': '#4d4d4f',
 'hAxis.baselineColor': 'red',
 'series': [{color: '#000', visibleInLegend: false}],
 'hAxis.gridlines.color': 'red',
 'vAxis.gridlines.color': 'red' };

Neither of the last two rules will work. Does anyone know what im doing wrong?


asgallant

unread,
Feb 15, 2012, 9:26:46 AM2/15/12
to google-visua...@googlegroups.com
using the dot notation only works if the base is already an option, ie:

var foo.bar "baz"// fails
var foo {};
foo.bar "baz"// succeeds 

Each option property that is, in an of itself an object, must be declared as an object, so your options should look like this:

var options {
    width410,
    height260,
    areaOpacity1,
    backgroundColor'#4d4d4f',
    series[{
        color'#000',
        visibleInLegendfalse
    }],
    hAxis{
        baselineColor'red',
        gridlines{
            color'red',
        }
    },
    vAxis{
        gridlines{
            color'red'
        }
    }
}; 

Nicholas Newlands

unread,
Feb 15, 2012, 10:04:11 AM2/15/12
to google-visua...@googlegroups.com
Thank you so much for this, im an idiot but with all the examples google have, it wouldn't have killed them to put up a proper demo. Thanks again.
Reply all
Reply to author
Forward
0 new messages