set width to '100%' and
window.onresize = function(event) {
drawVisualization();
}
On Friday, May 10, 2013 1:28:56 PM UTC-4, Sergey wrote:
My mistake, there is actually no way to do a percentage-based size in any
of our charts. But it's a reasonable feature, so we'll look into providing
Hello, the code actually does support percentages in width and height. You
can do this by specifying the option as width:100%. The tricky part here
is that the geochart likes to preserve its aspect ratio, so you need to
change your height in accordance with your width.
- Sergey
On Fri, May 10,
Hm...maybe I'm doing something wrong then. this is my code:
var geochart = new
google.visualization.GeoChart(document.getElementById('visualization'));
var options = {};
options['region'] = 'US';
options['resolution'] = 'provinces';
options['width'] = 100%;
Note also that this width is fixed at the time the chart is drawn; if the
window shrinks or expands (or a phone user rotates the screen), the chart
will not change size.
On Friday, May 10, 2013 9:35:45 AM UTC-4, Sergey wrote:
Hello, the code actually does support percentages in width and
You need to specify the percentage as a string. JavaScript doesn't natively
support percentage values. I'm surprised that what you wrote doesn't result
in a syntax error. The syntactically correct version of this would be:
var geochart = new
sigh. yes, that was my bug. Thanks!
---
Susanna Murley
skype: susannamurley
@susannamurley http://twitter.com/susannamurley
On Fri, May 10, 2013 at 10:03 AM, Sergey Grabkovsky gra...@google.comwrote:
You need to specify the percentage as a string. JavaScript doesn't
natively support
I've also learned that when I leave the width and height settings blank the
chart draws with the available space, so at 100%.
To bad the chart doesn't adapt and keeps the fixed size after being drawn,
like asgallant mentioned. It would be an awesome feature with all the
responsive layouts out
Actually, I went now to the google code Playground to test this out, but I
can't get the percentage to work. I mean, even if I put 20%, the map always
draws at 100%.
Example:
geochart.draw(data, {width: '20%'});
http://jsfiddle.net/cmoreira/TRnY7/
Is it because of the height?
It should, in theory, be possible to make the charts compatible with
responsive design (at least the SVG versions), but that may involve
extensive refactoring of the code base, so I would suggest filing a feature
request
You are correct, it seems the GoeCharts are ignoring percentage-based
dimensions.
On Friday, May 10, 2013 1:15:26 PM UTC-4, Carlos Moreira wrote:
Actually, I went now to the google code Playground to test this out, but I
can't get the percentage to work. I mean, even if I put 20%, the map
My mistake, there is actually no way to do a percentage-based size in any
of our charts. But it's a reasonable feature, so we'll look into providing
that in the future.
- Sergey
On Fri, May 10, 2013 at 1:15 PM, Carlos Moreira
carlostricks...@gmail.comwrote:
Actually, I went now to the google
11 matches
Mail list logo