Example usage for com.google.gwt.visualization.client DataTable create

List of usage examples for com.google.gwt.visualization.client DataTable create

Introduction

In this page you can find the example usage for com.google.gwt.visualization.client DataTable create.

Prototype

public static native DataTable create(JavaScriptObject jso) ;

Source Link

Usage

From source file:com.facebook.tsdb.tsdash.client.plot.InteractivePlot.java

License:Apache License

@Override
public void render(final Command onRendered) {
    if (!APILoaded) {
        GWT.log("Loading the API...");
        VisualizationUtils.loadVisualizationApi(new Runnable() {
            @Override//w w w  .  j  a v a2 s.  co  m
            public void run() {
                APILoaded = true;
                GWT.log("API loaded");
                render(onRendered);
            }
        }, AnnotatedTimeLine.PACKAGE);
        return;
    }
    if (timeSeriesJSON == null) {
        GWT.log("cannot render: null data");
        return;
    }
    DataTable dataTable = DataTable.create(timeSeriesJSON.getJavaScriptObject());
    Widget w = (Widget) container;
    final AnnotatedTimeLine newChart = new AnnotatedTimeLine(dataTable, getChartOptions(),
            (w.getOffsetWidth() - 10) + "px", (w.getOffsetHeight() - 10) + "px");
    newChart.addReadyHandler(new ReadyHandler() {
        @Override
        public void onReady(ReadyEvent event) {
            endRender(newChart);
            onRendered.execute();
        }
    });
    startRender(newChart);
}