Package com.google.gwt.visualization.client

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


* Google Visualization API in GWT demo.
*/
class Showcase implements EntryPoint {

  static DataTable getCompanyPerformance() {
    DataTable data = getCompanyPerformanceWithNulls();
    data.setValue(2, 1, 660);
    data.setValue(2, 2, 1120);
    return data;
  }
View Full Code Here


    data.setValue(2, 2, 1120);
    return data;
  }

  static DataTable getCompanyPerformanceWithNulls() {
    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);
    data.setValue(1, 0, "2005");
    data.setValue(1, 1, 1170);
    data.setValue(1, 2, 460);
    data.setValue(2, 0, "2006");
    data.setValueNull(2, 1);
    data.setValueNull(2, 2);
    data.setValue(3, 0, "2007");
    data.setValue(3, 1, 1030);
    data.setValue(3, 2, 540);
    return data;
  }
View Full Code Here

    data.setValue(3, 2, 540);
    return data;
  }

  static DataTable getDailyActivities() {
    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "Task");
    data.addColumn(ColumnType.NUMBER, "Hours per Day");
    data.addRows(5);
    data.setValue(0, 0, "Work");
    data.setValue(0, 1, 11);
    data.setValue(1, 0, "Eat");
    data.setValue(1, 1, 2);
    data.setValue(2, 0, "Commute");
    data.setValue(2, 1, 2);
    data.setValue(3, 0, "Watch TV");
    data.setValue(3, 1, 2);
    data.setValue(4, 0, "Sleep");
    data.setValue(4, 1, 7);
    return data;
  }
View Full Code Here

    data.setValue(4, 1, 7);
    return data;
  }

  static DataTable getSugarSaltAndCaloriesComparison() {
    DataTable data = DataTable.create();
    data.addColumn(ColumnType.NUMBER, "Sugar");
    data.addColumn(ColumnType.NUMBER, "Calories");
    data.addColumn(ColumnType.NUMBER, "Salt");
    data.addRows(4);
    data.setValue(0, 0, 20);
    data.setValue(0, 1, 11);
    data.setValue(0, 2, 30);
    data.setValue(1, 0, 30);
    data.setValue(1, 1, 10);
    data.setValue(1, 2, 20);
    data.setValue(2, 0, 27);
    data.setValue(2, 1, 2);
    data.setValue(2, 2, 34);
    data.setValue(3, 0, 22);
    data.setValue(3, 1, 2);
    data.setValue(3, 1, 9);
    return data;
  }
View Full Code Here

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

    DataTable data = Showcase.getSugarSaltAndCaloriesComparison();

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

    options.setSize(Size.LARGE);
    options.setAllowCollapse(true);
    options.setNodeClass(css.nodeClass());
    options.setSelectedNodeClass(css.selectedNodeClass());

    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "Name");
    data.addColumn(ColumnType.STRING, "Manager");
    data.addRows(5);
    data.setValue(0, 0, "Mike");
    data.setValue(1, 0, "Jim");
    data.setValue(1, 1, "Mike");
    data.setValue(2, 0, "Alice");
    data.setValue(2, 1, "Mike");
    data.setValue(3, 0, "Bob");
    data.setValue(3, 1, "Jim");
    data.setValue(4, 0, "Carol");
    data.setValue(4, 1, "Bob");

    OrgChart viz = new OrgChart(data, options);
    Label status = new Label();
    viz.addSelectHandler(new SelectionDemo(viz, status));
    panel.add(viz);
View Full Code Here

    options.set("chco", "00ff00,ff00ff");
    options.set("chg", "25.0,25.0,4.0,4.0");
    options.set("chm", "B,FF000080,0,1.0,5.0|B,FF990080,1,1.0,5.0");
    options.set("chls", "2,1,0|2,5,5");

    DataTable dataTable = DataTable.create();
    dataTable.addColumn(ColumnType.STRING);
    dataTable.addColumn(ColumnType.NUMBER);
    dataTable.addColumn(ColumnType.NUMBER);
    dataTable.addRows(8);

    char pi = '\u03C0';
    dataTable.setValue(0, 0, "0");
    dataTable.setValue(1, 0, pi + "/4");
    dataTable.setValue(2, 0, pi + "/2");
    dataTable.setValue(3, 0, "3" + pi + "/4");
    dataTable.setValue(4, 0, "" + pi);
    dataTable.setValue(5, 0, "5" + pi + "/4");
    dataTable.setValue(6, 0, "3" + pi + "/2");
    dataTable.setValue(7, 0, "7" + pi + "/4");

    dataTable.setValue(0, 1, 10);
    dataTable.setValue(1, 1, 20);
    dataTable.setValue(2, 1, 30);
    dataTable.setValue(3, 1, 40);
    dataTable.setValue(4, 1, 50);
    dataTable.setValue(5, 1, 60);
    dataTable.setValue(6, 1, 70);
    dataTable.setValue(7, 1, 80);

    dataTable.setValue(0, 2, 100);
    dataTable.setValue(1, 2, 80);
    dataTable.setValue(2, 2, 60);
    dataTable.setValue(3, 2, 30);
    dataTable.setValue(4, 2, 25);
    dataTable.setValue(5, 2, 20);
    dataTable.setValue(6, 2, 10);
    dataTable.setValue(7, 2, 5);
   
    widget = new ImageChart(dataTable, options);
  }
View Full Code Here

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

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

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

    Options options = Options.create();
    options.setHeight(300);
    options.setWidth(600);
    options.setState(STATE_STRING);
    DataTable data = DataTable.create();
    data.addRows(6);
    data.addColumn(ColumnType.STRING, "Fruit");
    data.addColumn(ColumnType.DATE, "Date");
    data.addColumn(ColumnType.NUMBER, "Sales");
    data.addColumn(ColumnType.NUMBER, "Expenses");
    data.addColumn(ColumnType.STRING, "Location");
    data.setValue(0, 0, "Apples");
    data.setValue(0, 2, 1000);
    data.setValue(0, 3, 300);
    data.setValue(0, 4, "East");
    data.setValue(1, 0, "Oranges");
    data.setValue(1, 2, 950);
    data.setValue(1, 3, 200);
    data.setValue(1, 4, "West");
    data.setValue(2, 0, "Bananas");
    data.setValue(2, 2, 300);
    data.setValue(2, 3, 250);
    data.setValue(2, 4, "West");
    data.setValue(3, 0, "Apples");
    data.setValue(3, 2, 1200);
    data.setValue(3, 3, 400);
    data.setValue(3, 4, "East");
    data.setValue(4, 0, "Oranges");
    data.setValue(4, 2, 900);
    data.setValue(4, 3, 150);
    data.setValue(4, 4, "West");
    data.setValue(5, 0, "Bananas");
    data.setValue(5, 2, 788);
    data.setValue(5, 3, 617);
    data.setValue(5, 4, "West");

    try {
      data.setValue(0, 1, new Date(year = 1988 - 1900, month = 0, day = 1));
      data.setValue(1, 1, new Date(year = 1988 - 1900, month = 0, day = 1));
      data.setValue(2, 1, new Date(year = 1988 - 1900, month = 0, day = 1));
      data.setValue(3, 1, new Date(year = 1988 - 1900, month = 1, day = 1));
      data.setValue(4, 1, new Date(year = 1988 - 1900, month = 1, day = 1));
      data.setValue(5, 1, new Date(year = 1988 - 1900, month = 1, day = 1));
    } catch (JavaScriptException ex) {
      GWT.log("Error creating data table - Date bug on mac?", ex);
    }

    final MotionChart motionChart = new MotionChart(data, options);
View Full Code Here

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

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

    Label status = new Label();
    Label onMouseOverAndOutStatus = new Label();
    viz.addSelectHandler(new SelectionDemo(viz, status));
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.