I am working on learning GWT (total newb) and asking a question regarding the visualization API provided by Google. This page: http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted
Describes getting started with a pie chart (this is what I need). However, I am trying to do this in a composite user interface using UiBinder. To this end, I don't know how to handle the callback correctly, which is shown:
public class SimpleViz implements EntryPoint { public void onModuleLoad() {
My first guess is that it will be in the UiBinder constructor, right? But this assumes that I want to put the item in the RootLayoutPanel, and I will not. I do not see an elegant and obvious way to place it in a binder. I maintain that even this assumption may be wrong. Any ideas from experts?
EDIT: I have to clarify my attempt:
public GraphPanel() { initWidget(uiBinder.createAndBindUi(this)); Runnable onLoadCallback = new Runnable() { public void run() {
On startup, I get the following in Composites DIV:
<div class="gwt-viz-container"></div>
But I do not see a graph using the code on the page above.
EDIT 2: This link may provide additional information. However, the proposed solution is not optimal, since the application should know more about widgets (and if the widget is there even there). http://vaadin.com/forum/-/message_boards/message/97850
EDIT 3: It doesn't matter, but just in case, I run FF on Linux. Some articles that I read suggest that this is a problem.
EDIT 4: Addendum:
pie.draw(createPieTable(), createPieOptions());
after the append child displays the graph. This means that the order of the example is incorrect. If so, which one is optimal?