James Moger
2014-04-10 e2dfad080a46368950f387c88103561e07c9afa6
src/main/java/com/gitblit/wicket/WicketUtils.java
@@ -38,8 +38,6 @@
import org.apache.wicket.protocol.http.WebRequest;
import org.apache.wicket.resource.ContextRelativeResource;
import org.eclipse.jgit.diff.DiffEntry.ChangeType;
import org.wicketstuff.googlecharts.AbstractChartData;
import org.wicketstuff.googlecharts.IChartData;
import com.gitblit.Constants;
import com.gitblit.Constants.AccessPermission;
@@ -632,32 +630,6 @@
      return label;
   }
   public static IChartData getChartData(Collection<Metric> metrics) {
      final double[] commits = new double[metrics.size()];
      final double[] tags = new double[metrics.size()];
      int i = 0;
      double max = 0;
      for (Metric m : metrics) {
         commits[i] = m.count;
         if (m.tag > 0) {
            tags[i] = m.count;
         } else {
            tags[i] = -1d;
         }
         max = Math.max(max, m.count);
         i++;
      }
      IChartData data = new AbstractChartData(max) {
         private static final long serialVersionUID = 1L;
         @Override
         public double[][] getData() {
            return new double[][] { commits, tags };
         }
      };
      return data;
   }
   public static double maxValue(Collection<Metric> metrics) {
      double max = Double.MIN_VALUE;
      for (Metric m : metrics) {
@@ -667,31 +639,4 @@
      }
      return max;
   }
   public static IChartData getScatterData(Collection<Metric> metrics) {
      final double[] y = new double[metrics.size()];
      final double[] x = new double[metrics.size()];
      int i = 0;
      double max = 0;
      for (Metric m : metrics) {
         y[i] = m.count;
         if (m.duration > 0) {
            x[i] = m.duration;
         } else {
            x[i] = -1d;
         }
         max = Math.max(max, m.count);
         i++;
      }
      IChartData data = new AbstractChartData(max) {
         private static final long serialVersionUID = 1L;
         @Override
         public double[][] getData() {
            return new double[][] { x, y };
         }
      };
      return data;
   }
}