Package de.intranda.commons.chart.results

Examples of de.intranda.commons.chart.results.DataRow


    }
    StringBuilder title = new StringBuilder(StatisticsMode.getByClassName(this.getClass()).getTitle());

    DataTable dtbl = new DataTable(title.toString());
    dtbl.setShowableInPieChart(true);
    DataRow dRow = new DataRow(Helper.getTranslation("count"));

    for (Object obj : crit.list()) {
      Schritt step = (Schritt) obj;
      for (Benutzergruppe group : step.getBenutzergruppenList()) {
        dRow.addValue(group.getTitel(), dRow.getValue(group.getTitel()) + 1);
      }
    }

    dtbl.addDataRow(dRow);
    List<DataTable> allTables = new ArrayList<DataTable>();
View Full Code Here


    // building table for the Table
    DataTable dtbl = new DataTable(title.toString());
    // building a second table for the chart
    DataTable dtblChart = new DataTable(title.toString());
    //
    DataRow dataRowChart;
    DataRow dataRow;

    // each data row comes out as an Array of Objects
    // the only way to extract the data is by knowing
    // in which order they come out
    for (Object obj : list) {
      dataRowChart = new DataRow(null);
      dataRow = new DataRow(null);
      Object[] objArr = (Object[]) obj;
      try {

        // getting localized time group unit

        // String identifier = timeGrouping.getTitle();
        // setting row name with localized time group and the date/time extraction based on the group

        dataRowChart.setName(new Converter(objArr[2]).getString() + "");
        dataRow.setName(new Converter(objArr[2]).getString() + "");
        // dataRow.setName(new Converter(objArr[2]).getString());

        // building up row depending on requested output having different fields
        switch (this.cu) {

        case volumesAndPages: {
          dataRowChart.addValue(CalculationUnit.volumes.getTitle(), (new Converter(objArr[0]).getDouble()));
          dataRowChart.addValue(CalculationUnit.pages.getTitle() + " (*100)", (new Converter(objArr[1]).getDouble()) / 100);

          dataRow.addValue(CalculationUnit.volumes.getTitle(), (new Converter(objArr[0]).getDouble()));
          dataRow.addValue(CalculationUnit.pages.getTitle(), (new Converter(objArr[1]).getDouble()));

        }
          break;

        case volumes: {
          dataRowChart.addValue(CalculationUnit.volumes.getTitle(), (new Converter(objArr[0]).getDouble()));
          dataRow.addValue(CalculationUnit.volumes.getTitle(), (new Converter(objArr[0]).getDouble()));

        }
          break;

        case pages: {

          dataRowChart.addValue(CalculationUnit.pages.getTitle(), (new Converter(objArr[1]).getDouble()));
          dataRow.addValue(CalculationUnit.pages.getTitle(), (new Converter(objArr[1]).getDouble()));

        }
          break;

        }

        // fall back, if conversion triggers an exception
      } catch (Exception e) {
        dataRowChart.addValue(e.getMessage(), new Double(0));
        dataRow.addValue(e.getMessage(), new Double(0));
      }

      // finally adding dataRow to DataTable and fetching next row
      // adding the extra table
      dtblChart.addDataRow(dataRowChart);
View Full Code Here

      int countRowsInTable = 0;
      while (countRowsInTable < table.getDataRowsSize()) {
        List<DataRow> rows = table.getDataRows();
        ListIterator<DataRow> countRowInRows = rows.listIterator();
        while (countRowInRows.hasNext()) {
          DataRow row = countRowInRows.next();
          int number = row.getNumberValues();
          int countValuesInRow = 0;
          while (countValuesInRow < number) {
            countValuesInRow++;
            assertNotNull(row);
          }
View Full Code Here

    test.setTimeUnit(TimeUnit.days);
    List<DataTable> tables = test.getDataTables(testFilter);
    java.util.Iterator<DataTable> tablesIterator = tables.iterator();
    int counter = 0;
    DataTable table = null;
    DataRow row = null;
    while (tablesIterator.hasNext()){
      table = tablesIterator.next();
      List<DataRow> rows = table.getDataRows();
      java.util.Iterator<DataRow> rowsIterator = rows.iterator();
      while (rowsIterator.hasNext()){
        row = rowsIterator.next();
      counter += row.getMaxValue();
      }
    }
    // count on max value of each row on test database should be 13
    assertEquals(counter, 13);
  }
View Full Code Here

TOP

Related Classes of de.intranda.commons.chart.results.DataRow

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.