The options work exactly the same way with ChartWrappers as they do with
the base charts; you are just passing the options object to the "options"
parameter of the wrapper instead of in the draw call:
var chart = new google.visualization.ChartWrapper({
chartType: 'ColumnChart',
containerId: 'chart_div',
dataTable: data,
options: {
title: 'Admits',
width: 600,
height: 400,
hAxis: {
title: 'Chart Title'
}
}
});
You can also create a separate options object and pass it in like this:
var options = {
title: 'Admits',
width: 600,
height: 400,
hAxis: {
title: 'Chart Title'
}
};
var chart = new google.visualization.ChartWrapper({
chartType: 'ColumnChart',
containerId: 'chart_div',
dataTable: data,
options: options
});
On Tuesday, April 30, 2013 12:11:57 PM UTC-4, [email protected] wrote:
>
> I am able to add an haxis title like this when drawing a chart like this:
>
> var options = {
> legend: 'none',
> colors:['#006BA4'],
> chartArea:{left:60,top:10,width:'65%',height:"75%"},
>
> hAxis: {title: 'Hour of Day',
> titleTextStyle: {color: '#5c5c5c'}
> },
> gridlines: {count: 15, Color: '#fffff'},
>
> vAxis: {title: 'Admits',
> titleTextStyle: {color: '#5c5c5c'}}
> };
>
> var chart = new
> google.visualization.ColumnChart(document.getElementById('chart_div'));
> chart.draw(data, options);
>
> But when I draw a chart like this I can't get the syntax right for adding
> an haxis or vaxis. Any help appreciated.
>
> var chart = new google.visualization.ChartWrapper({
> chartType: 'ColumnChart',
> containerId: 'chart_div',
> dataTable: data,
> options: {
> title: 'Admits',
> width: 600,
> height: 400
> }
> });
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.