Package com.google.gwt.visualization.client

Examples of com.google.gwt.visualization.client.DataTable


      // has been loaded.
      Runnable onLoadCallback = new Runnable() {
        public void run() {

          // Create nodes table with some data
          DataTable nodes = DataTable.create();
          nodes.addColumn(DataTable.ColumnType.NUMBER, "id");
          nodes.addColumn(DataTable.ColumnType.STRING, "text");
          nodes.addColumn(DataTable.ColumnType.STRING, "image");
          nodes.addColumn(DataTable.ColumnType.STRING, "style");

          // Create links table with some data
          DataTable links = DataTable.create();
          links.addColumn(DataTable.ColumnType.NUMBER, "from");
          links.addColumn(DataTable.ColumnType.NUMBER, "to");
          links.addColumn(DataTable.ColumnType.NUMBER, "length");

          addRow(nodes, 1, "Main", DIR + "Network-Pipe-icon.png", "image");
          addRow(nodes, 2, "Office", DIR + "Network-Pipe-icon.png", "image");
          addRow(nodes, 3, "Wireless", DIR + "Network-Pipe-icon.png", "image");
          addRow(links, 1, 2, LENGTH_MAIN);
View Full Code Here


   
    network.addPackages(packages.getJavaScriptObject());
  }

  void deletePackage() {
    DataTable packages = DataTable.create();
    packages.addColumn(DataTable.ColumnType.NUMBER, "id");
    packages.addColumn(DataTable.ColumnType.NUMBER, "from");
    packages.addColumn(DataTable.ColumnType.NUMBER, "to");
    packages.addColumn(DataTable.ColumnType.STRING, "action");
    packages.addRow();
    int i = 0;
    packages.setValue(i, 0, packageId);
    packages.setValue(i, 3, "delete");

    network.addPackages(packages);
  }
View Full Code Here

    // Create a callback to be called when the visualization API
    // has been loaded.
    Runnable onLoadCallback = new Runnable() {
      public void run() {
        // Create and populate a data table.
        DataTable data = DataTable.create();
        data.addColumn(DataTable.ColumnType.DATETIME, "time");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function A");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function B");

        DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd");

        // create data
        Date d = dtf.parse("2010-08-23");
        int n = 200; // number of datapoints
        for (int i = 0; i < n; i++) {
          data.addRow();
          data.setValue(i, 0, new Date(d.getTime()));
          data.setValue(i, 1, customFunctionA(i));
          data.setValue(i, 2, customFunctionB(i));
          d.setTime(d.getTime() + 1000 * 60); // steps of one minute
        }
       
        Graph.Options options = Graph.Options.create();
        options.setHeight("400px");
View Full Code Here

   * Returns a table filled with data
   * @return data
   */
  private DataTable createDataTable() {
   
    DataTable data = DataTable.create();
    data.addColumn(DataTable.ColumnType.DATETIME, "start");
    data.addColumn(DataTable.ColumnType.DATETIME, "end");
    data.addColumn(DataTable.ColumnType.STRING, "content");

    DateTimeFormat df = DateTimeFormat.getFormat("yyyy-MM-dd");
    DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");

    int n = 0;
   
    data.addRow();
    data.setValue(n, 0, df.parse("2010-08-23"));
    data.setValue(n, 2, "<div>Conversation</div><img src='img/comments-icon.png' style='width:32px; height:32px;'>");
    n++;

    data.addRow();
    data.setValue(n, 0, dtf.parse("2010-08-23 23:00:00"));
    data.setValue(n, 2, "<div>Mail from boss</div><img src='img/mail-icon.png' style='width:32px; height:32px;'>");
    n++;

    data.addRow();
    data.setValue(n, 0, dtf.parse("2010-08-24 16:00:00"));
    data.setValue(n, 2, "Report");
    n++;

    data.addRow();
    data.setValue(n, 0, df.parse("2010-08-26"));
    data.setValue(n, 1, df.parse("2010-09-02"));
    data.setValue(n, 2, "Traject A");
    n++;

    data.addRow();
    data.setValue(n, 0, df.parse("2010-08-28"));
    data.setValue(n, 2, "<div>Memo</div><img src='img/notes-edit-icon.png' style='width:48px; height:48px;'>");
    n++;

    data.addRow();
    data.setValue(n, 0, df.parse("2010-08-29"));
    data.setValue(n, 2, "<div>Phone call</div><img src='img/Hardware-Mobile-Phone-icon.png' style='width:32px; height:32px;'>");
    n++;

    data.addRow();
    data.setValue(n, 0, df.parse("2010-08-31"));
    data.setValue(n, 1, df.parse("2010-09-03"));
    data.setValue(n, 2, "Traject B");
    n++;

    data.addRow();
    data.setValue(n, 0, dtf.parse("2010-09-04 12:00:00"));
    data.setValue(n, 2, "<div>Report</div><img src='img/attachment-icon.png' style='width:32px; height:32px;'>");
    n++;
     
    return data;
  }
View Full Code Here

            setRange();
          }
        });

        // Create and populate a data table.
        DataTable data = DataTable.create();
        data.addColumn(DataTable.ColumnType.DATETIME, "time");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function A");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function B");

        DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd");

        // create data
        Date d = dtf.parse("2010-08-23");
        int n = 1000; // number of datapoints
        for (int i = 0; i < n; i++) {
          data.addRow();
          data.setValue(i, 0, new Date(d.getTime()));
          data.setValue(i, 1, customFunction(i) / 100);
          data.setValue(i, 2, customFunction2(i) / 100);
          d.setTime(d.getTime() + 1000 * 60); // steps of one minute
        }
       
        Graph.Options options = Graph.Options.create();
        options.setHeight("400px");
View Full Code Here

            setRange();
          }
        });

        // Create and populate a data table.
        DataTable data = DataTable.create();
        data.addColumn(DataTable.ColumnType.DATETIME, "time");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function A");
        data.addColumn(DataTable.ColumnType.NUMBER, "Function B");

        DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd");

        // create data
        Date d = dtf.parse("2010-08-23");
        int n = 10000; // number of datapoints
        for (int i = 0; i < n; i++) {
          data.addRow();
          data.setValue(i, 0, new Date(d.getTime()));
          data.setValue(i, 1, customFunction(i));
          data.setValue(i, 2, customFunction2(i));
          d.setTime(d.getTime() + 1000 * 60); // steps of one minute
        }
               
        Graph.Options options = Graph.Options.create();
        options.setHeight("400px");
View Full Code Here

    AxisOptions vAxisOptions = AxisOptions.create();
    vAxisOptions.setMinValue(0);
    vAxisOptions.setMaxValue(2000);
    options.setVAxisOptions(vAxisOptions);

    DataTable data = Showcase.getCompanyPerformance();
    AreaChart viz = new AreaChart(data, options);

    Label status = new Label();
    Label onMouseOverAndOutStatus = new Label();
    viz.addSelectHandler(new SelectionDemo(viz, status));
View Full Code Here

    options.setGaugeRange(0, 24);
    options.setGreenRange(0, 6);
    options.setYellowRange(6, 12);
    options.setRedRange(12, 24);

    DataTable data = Showcase.getDailyActivities();
   
    widget = new Gauge(data, options);
  }
View Full Code Here

  private Widget widget;
 
  public IntensityDemo() {
    Options options = Options.create();

    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "", "Country");
    data.addColumn(ColumnType.NUMBER, "Population (mil)", "a");
    data.addColumn(ColumnType.NUMBER, "Area (km2)", "b");
    data.addRows(5);
    data.setValue(0, 0, "CN");
    data.setValue(0, 1, 1324);
    data.setValue(0, 2, 9640821);
    data.setValue(1, 0, "IN");
    data.setValue(1, 1, 1133);
    data.setValue(1, 2, 3287263);
    data.setValue(2, 0, "US");
    data.setValue(2, 1, 304);
    data.setValue(2, 2, 9629091);
    data.setValue(3, 0, "ID");
    data.setValue(3, 1, 232);
    data.setValue(3, 2, 1904569);
    data.setValue(4, 0, "BR");
    data.setValue(4, 1, 187);
    data.setValue(4, 2, 8514877);
   
    widget = new IntensityMap(data, options);
  }
View Full Code Here

public class PieDemo implements LeftTabPanel.WidgetProvider {
  public Widget getWidget() {
    VerticalPanel result = new VerticalPanel();

    /* create a datatable */
    DataTable data = Showcase.getDailyActivities();

    /* create pie chart */
    PieChart.PieOptions options = PieChart.createPieOptions();
    options.setWidth(400);
    options.setHeight(240);
View Full Code Here

TOP

Related Classes of com.google.gwt.visualization.client.DataTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.