Thanks for the reply - actually I think my problem isn't necessarily
to do with the visualization directly, but rather just the new gwt
layout Panels living in a Runnable.
Anyway, google visualization provides this sample code with works
great:
public void onModuleLoad() {
// Create a callback to be called when the visualization API
// has been loaded.
Runnable onLoadCallback = new Runnable() {
public void run() {
Panel panel = RootPanel.get();
// Create a pie chart visualization.
PieChart pie = new PieChart(createTable(), createOptions());
pie.addSelectHandler(createSelectHandler(pie));
panel.add(pie);
}
};
// Load the visualization api, passing the onLoadCallback to be
called
// when loading is done.
VisualizationUtils.loadVisualizationApi(onLoadCallback,
PieChart.PACKAGE, Table.PACKAGE);
}
However, I just change the RootPanel -> RootLayoutPanel, as so:
public void onModuleLoad() {
// Create a callback to be called when the visualization API
// has been loaded.
Runnable onLoadCallback = new Runnable() {
public void run() {
Panel panel = RootLayoutPanel.get(); // Using GWT 2.0 Panel
// Create a pie chart visualization.
PieChart pie = new PieChart(createTable(), createOptions());
pie.addSelectHandler(createSelectHandler(pie));
panel.add(pie);
}
};
// Load the visualization api, passing the onLoadCallback to be
called
// when loading is done.
VisualizationUtils.loadVisualizationApi(onLoadCallback,
PieChart.PACKAGE, Table.PACKAGE);
Then I notice the visualization (piechart) disappearing. However if I
scan the dom it seems like the
necessary html is produced.
I'm using Chrome and FF.
Thanks for you help!
On Feb 23, 2:33 am, MC Get Vizzy <[email protected]> wrote:
> I haven't been able to reproduce this problem. Layout panels work fine for
> me. What browser are you using? What visualizations are you using? Can
> you send some sample code?
>
> thanks,
>
> MC Get Vizzy
>
> On Sat, Feb 20, 2010 at 1:02 AM, hsi <[email protected]> wrote:
> > Hi folks, I was wondering how the Visualization widgets integrate with
> > the new GWT 2.0 Layout Panels?
>
> > I am specifically referring to new Layout Panels listed to here:
> >http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html
>
> > I have been able to get the "Getting Started with Visualizations" demo
> > working (http://code.google.com/docreader/#p=gwt-google-apis&s=gwt-
> > google-apis&t=VisualizationGettingStarted<http://code.google.com/docreader/#p=gwt-google-apis&s=gwt-%0Agoogle-a...>).
> > Interestingly enough
> > however, when I try to change the panel structure to use some new GWT
> > 2.0 layout panels, either by changing RootPanel to RootLayoutPanel or
> > simply incorporating a new layout panel within the RootPanel, the
> > visualization does not appear to show up.
>
> > A cursory inspection of the generated html seems to show that the
> > underlying dom for the visualization is still generated, unfortunately
> > nothing appears to render.
>
> > Occasionally on a refresh, the visualization widget will show up very
> > briefly and then disappear...
>
> > Has anyone encountered this problem or have any suggestions? Thanks!
>
> > --
> > 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]<google-visualization-api%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-visualization-api?hl=en.
--
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.