Hi Vizzy Thanks for your comments on above issue. Actually, I am also facing same type of problem. After reading your comments, I assume problem is from visualization side. A visualization can't be attached more than once to any parent. DockPanel re-attach all it's widgets whenever we add some widget in it and that's why some visualizations don't work well with DockPanel.
For the time being, I have done some alternate (I re-create visualization widget whenever it needs to be re-attached), but can we hope for a fix of this problem in near future. Any comment here will really helpful in deciding my road map with visualization. Ganesh On Jul 22, 5:20 pm, MC Get Vizzy <[email protected]> wrote: > this is a known issue. some visualizations do not play well with GWT's > DockPanel and TabPanel. > > On Wed, Jul 22, 2009 at 2:43 PM, Rick <[email protected]> wrote: > > > Hi all > > > I am using GWT 1.6 and Google Visualizations to show graph in my > > application. I have to show multiple graphs to user. For this, I am > > adding my visualization graphs in a DockPanel with direction. Now If I > > add graphs before attaching DockPanel, all graphs are rendered > > properly in all browsers. But I have to do my work after attaching > > DockPanel. In this case, in Mozilla and Chrome, only last graph added > > in dockpanel get rendered where as in IE, all graphs are rendered > > properly. Kindly note that this problem occurs only when I am adding > > Graphs in DockPanel. In other containers like VerticalPanel & > > HorizontalPanel, I can add Graphs after attaching container, it works > > well. > > > Below is a sample code to produce this case. Any help/suggestion will > > be highly appriciated. > > > Code: > > > package com.example.simpleviz.client; > > > import com.google.gwt.core.client.EntryPoint; > > import com.google.gwt.user.client.ui.DockPanel; > > import com.google.gwt.user.client.ui.RootPanel; > > import com.google.gwt.user.client.ui.Widget; > > import com.google.gwt.visualization.client.DataTable; > > import com.google.gwt.visualization.client.VisualizationUtils; > > import > > com.google.gwt.visualization.client.AbstractDataTable.ColumnType; > > import com.google.gwt.visualization.client.visualizations.BarChart; > > import com.google.gwt.visualization.client.visualizations.PieChart; > > import > > com.google.gwt.visualization.client.visualizations.PieChart.Options; > > > public class MyClass implements EntryPoint { > > > public void onModuleLoad() { > > > VisualizationUtils.loadVisualizationApi(new Runnable() { > > public void run() { > > Widget bar = createBarChart(); > > Widget pie = createPieChart(); > > DockPanel d = new DockPanel(); > > RootPanel.get().add(d); > > d.add(bar, DockPanel.NORTH); > > d.add(pie, DockPanel.NORTH); > > } > > > }, new String[] { BarChart.PACKAGE, PieChart.PACKAGE}); > > > } > > > private Widget createPieChart() { > > DataTable data = DataTable.create(); > > data.addColumn(ColumnType.STRING, "Task"); > > data.addColumn(ColumnType.NUMBER, "Hours per Day"); > > data.addRows(1); > > data.setValue(0, 0, "Work"); > > data.setValue(0, 1, 10); > > > Options options = Options.create(); > > options.setWidth(200); > > options.setHeight(100); > > options.set3D(true); > > options.setTitle("My Daily Activities"); > > > PieChart pie = new PieChart(data, options); > > return pie; > > } > > > public Widget createBarChart() { > > DataTable data = DataTable.create(); > > data.addColumn(ColumnType.STRING, "Year"); > > data.addColumn(ColumnType.NUMBER, "Sales"); > > data.addColumn(ColumnType.NUMBER, "Expenses"); > > data.addRows(4); > > data.setValue(0, 0, "2004"); > > data.setValue(0, 1, 1000); > > data.setValue(0, 2, 400); > > > BarChart.Options options = BarChart.Options.create(); > > options.setWidth(200); > > options.setHeight(100); > > options.set3D(true); > > options.setTitle("My Daily Activities"); > > > BarChart barchart = new BarChart(data, options); > > return barchart; > > } > > > } > > > Thanks and regards > > > Rick --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
