code: double[] findMinMax(Collection<?> data, DataType dataType) {
  
      double min = Double.MAX_VALUE;
      double max = -Double.MAX_VALUE;
  
      for (Object dataPoint : data) {
  
        if (dataPoint == null) {
          continue;
        }
  
        double value = 0.0;
  
        if (dataType == DataType.Number) {
          value = ((Number) dataPoint).doubleValue();
        } else if (dataType == DataType.Date) {
          Date date = (Date) dataPoint;
          value = date.getTime();
        } else if (dataType == DataType.String) {
          return new double[] {Double.NaN, Double.NaN};
        }
        if (value < min) {
          min = value;
        }
        if (value > max) {
          max = value;
        }
      }
  
      return new double[] {min, max};
    }
docs: Finds the min and max of a dataset
  
  @param data
  @return