I am trying to program a bar chart using Google Visualizations.
https://developers.google.com/chart/interactive/docs/gallery/barchart
The bar chart is dynamically generated and changed several times.
Google Visualizations seems to have trouble detecting the dimensions of a div element that I dynamically appended via jQuery. Hence, I would like to hard code the dimensions of the bar chart into the options that I feed into Google Visualizations.
How do I do that?
I have tried these options.
var options = {
title: 'Comparing Kangeroos and Wallabies',
vAxis: {title: 'Factors', titleTextStyle: {color: 'red'}},
legend: 'bottom',
chartArea.width: '400px',
fontName: 'Arial Narrow'
};
However, Chrome Web Developer just notes that there is an unexpected period in “chartArea.width.”
The example shows:
So try “width” instead of “chartArea.width”