/**
   * precondition : 'attribute' MUST contain number values only
   *
   * @param cases
   * @param attribute
   * @return DefaultXYDataset with all values of 'attribute' against event numbers or timestamps.
   */
  private XYSeriesCollection getDataAttributes(
      String[] attributes, boolean byTime, double timesize) {
    XYSeriesCollection result = new XYSeriesCollection();
    for (int index = 0; index < attributes.length; index++) {
      String attribute = attributes[index];
      Integer i = 0;
      XYSeries row = new XYSeries(attribute);
      for (ProcessInstance pi : mylog.getInstances()) {
        Integer x = 0; // count event number
        Date begin = pi.getAuditTrailEntries().first().getTimestamp(); // starting
        // time
        // of
        // process
        // instance

        for (AuditTrailEntry ate : pi.getListOfATEs()) {
          if (ate.getAttributes().containsKey(attribute)) {
            Double val;
            val = Double.valueOf(ate.getAttributes().get(attribute));
            if (byTime) {
              row.add(timediff(begin, ate.getTimestamp()) / timesize, val.doubleValue());
            } else {
              row.add(x.doubleValue(), val.doubleValue());
            }
          }
          x++; // event number in case
        }
        i++; // case number
      }
      result.addSeries(row);
    }
    return result;
  }
 /** @return String[] with all unique attributes on element level */
 private String[] getAttributes() {
   HashSet<String> results = new HashSet();
   for (ProcessInstance pi : mylog.getInstances()) {
     for (AuditTrailEntry ate : pi.getListOfATEs()) {
       results.addAll(ate.getAttributes().keySet());
     }
   }
   String[] t = new String[results.size()];
   return results.toArray(t);
 }
 private IntervalXYDataset getHistrogrammedDataAttributes(
     String[] attributes, long barsize, long timesize) {
   IntervalXYDataset dataset = null;
   if (no_intervals) {
     dataset = new XYSeriesCollection();
   } else {
     dataset = new YIntervalSeriesCollection();
   }
   for (int index = 0; index < attributes.length; index++) {
     Histogram histogram = new Histogram(barsize);
     String attribute = attributes[index];
     for (ProcessInstance pi : mylog.getInstances()) {
       Date begin;
       try {
         begin = pi.getAuditTrailEntryList().get(0).getTimestamp();
       } catch (Exception e) {
         Message.add(e.getMessage(), Message.ERROR);
         return null;
       } // starting time of process instance
       int j = 0;
       for (AuditTrailEntry ate : pi.getListOfATEs()) {
         if (ate.getAttributes().containsKey(attribute)) {
           Double val;
           val = Double.valueOf(ate.getAttributes().get(attribute));
           if (xbox.getSelectedIndex() == 2) {
             histogram.addValue(j, val);
           }
           if (xbox.getSelectedIndex() == 3) {
             histogram.addValue(timediff(begin, ate.getTimestamp()), val);
           }
           j++;
         }
       }
     }
     if (no_intervals) {
       ((XYSeriesCollection) dataset).addSeries(histogram.getXYSeries(attribute, timesize));
     } else {
       ((YIntervalSeriesCollection) dataset)
           .addSeries(histogram.getYIntervalSeries(attribute, timesize));
     }
   }
   return dataset;
 }