Package com.google.visualization.datasource.query

Examples of com.google.visualization.datasource.query.QueryLabels.addLabel()


    selection.addColumn(new SimpleColumn("name"));
    selection.addColumn(new SimpleColumn("isAlive"));
    query.setSelection(selection);

    QueryLabels labels = new QueryLabels();
    labels.addLabel(new SimpleColumn("isAlive"),
        "New isAlive Label");
    query.setLabels(labels);

    DataTable res = QueryEngine.executeQuery(query, data, ULocale.US);
View Full Code Here


    QueryPivot pivot = new QueryPivot();
    pivot.addColumn(new SimpleColumn("Band"));
    pivot.addColumn(new SimpleColumn("Songs"));
    query.setPivot(pivot);
    QueryLabels labels = new QueryLabels();
    labels.addLabel(selectedColumn, "foo");
    query.setLabels(labels);
    QueryFormat format = new QueryFormat();
    format.addPattern(selectedColumn, "'$'@@@");
    query.setUserFormatOptions(format);
View Full Code Here

        if (query.hasLabels()) {
          dataSourceQuery.setLabels(null);
          QueryLabels labels = query.getLabels();
          QueryLabels newLabels = new QueryLabels();
          for (AbstractColumn column : labels.getColumns()) {
            newLabels.addLabel(new SimpleColumn(column.getId()), labels.getLabel(column));
          }
          completionQuery.setLabels(newLabels);
        }
        if (query.hasUserFormatOptions()) {
          dataSourceQuery.setUserFormatOptions(null);
View Full Code Here

    assertFalse(dataSourceQuery.hasPivot());
  }
 
  public void testSplittingSQLWithPivotWithLabel() throws Exception {
    QueryLabels labels = q.getLabels();
    labels.addLabel(new AggregationColumn(new SimpleColumn("B"), AggregationType.MAX), "bar");
    q.setLabels(labels);
    QueryPair split = QuerySplitter.splitQuery(q, Capabilities.SQL);
    Query dataSourceQuery = split.getDataSourceQuery();

    assertFalse(dataSourceQuery.hasSelection());
View Full Code Here

                                               ComparisonFilter.Operator.GT);
    q.setFilter(filter);
    q.setRowLimit(7);
    q.setRowOffset(17);
    QueryLabels labels = new QueryLabels();
    labels.addLabel(new SimpleColumn("A"), "bar");
    q.setLabels(labels);
    QueryFormat format = new QueryFormat();
    format.addPattern(new SimpleColumn("A"), "foo");
    q.setUserFormatOptions(format);
    QueryOptions options = new QueryOptions();
View Full Code Here

                if(query.hasLabels()) {
                    dataSourceQuery.setLabels(null);
                    QueryLabels labels = query.getLabels();
                    QueryLabels newLabels = new QueryLabels();
                    for(AbstractColumn column : labels.getColumns()) {
                        newLabels.addLabel(new SimpleColumn(column.getId()), labels.getLabel(column));
                    }
                    completionQuery.setLabels(newLabels);
                }
                if(query.hasUserFormatOptions()) {
                    dataSourceQuery.setUserFormatOptions(null);
View Full Code Here

        if (query.hasLabels()) {
          dataSourceQuery.setLabels(null);
          QueryLabels labels = query.getLabels();
          QueryLabels newLabels = new QueryLabels();
          for (AbstractColumn column : labels.getColumns()) {
            newLabels.addLabel(new SimpleColumn(column.getId()), labels.getLabel(column));
          }
          completionQuery.setLabels(newLabels);
        }
        if (query.hasUserFormatOptions()) {
          dataSourceQuery.setUserFormatOptions(null);
View Full Code Here

  AbstractColumn column;
  String label;
    jj_consume_token(KW_LABEL);
    column = abstractColumnDescriptor();
    label = stringLiteral();
    labels.addLabel(column, label);
    label_5:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case OP_COMMA:
        ;
View Full Code Here

        break label_5;
      }
      jj_consume_token(OP_COMMA);
      column = abstractColumnDescriptor();
      label = stringLiteral();
      labels.addLabel(column, label);
    }
    query.setLabels(labels);
  }

// The format clause (e.g., FORMAT c1 "#", c3 "dd-MM-YYYY")
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.