Hi,
If I understand correctly, you want to resize the chart whenever the number 
of rows displayed changes, so that each bar maintains the same thickness. 
Right?

what about this:

- dashboard fires a 'ready' event whenever any part of it redraws (such as 
the chart redrawing because of a control change)
- you can always query a chartwrapper (or controlwrapper) and ask it for the 
datatable it received in its last draw (via chartWrapper.getDataTable())

so you could add a 'ready' event listener to the dashboard and resize the 
chart whenever its size is not the one you want:

...
var dash = new 
 google.visualization.Dashboard(document.getElementById('dashboard'));

google.visualization.events.addListener(dash, 'ready', function() {
  // Dashboard redraw, have a look at how many rows the barChart is 
displaying
  var numRows = barChart.getDataTable().getNumberOfRows();
  var expectedHeight = numRows * 60;
  if (parseInt(barChart.getOption('height'), 10) != expectedHeight) {
    // Update the chart options and redraw just it
    barChart.setOption('height', expectedHeight);
    barChart.draw();
  }
});

dash.bind(...);
dash.draw(data);

I tried it briefly locally and it seems to work.
Mind that barChart.draw() triggers a dashboard 'ready' event too (since the 
chart is part of the dashboard), so that if() statement that I added is 
important to avoid entering an infinite loop where the 'ready' event handler 
keeps calling itself.

/R.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to