Permalink
Browse files

Use NVD3 for charts.

  • Loading branch information...
mustpax committed Dec 25, 2012
1 parent 18bb5c5 commit 7bade5d522069a9a3721dbe42e6e88899617a05b
Showing with 17,596 additions and 48 deletions.
  1. +2 −0 app/controllers/Admin.java
  2. +6 −2 app/views/Admin/usageStats.html
  3. +5 −1 app/views/js-templates.html
  4. +628 −0 public/css/nv.d3.css
  5. +6 −0 public/css/styles.css
  6. +7,026 −0 public/js/d3.v2.js
  7. +9,884 −0 public/js/nv.d3.js
  8. +39 −45 public/js/usageStats.js
@@ -74,6 +74,7 @@ public static void stats() {
public static void usageStats(boolean fake) {
if (Play.mode.isDev() && fake) {
+ Logger.warn("Generating fake data.");
long users = 0L;
long rules = 30L;
long fileMoves = 100L;
@@ -97,6 +98,7 @@ public static void usageStats(boolean fake) {
dus.created = cur;
dus.save();
}
+ Logger.warn("Done generating fake data.");
}
User user = Login.getUser();
@@ -2,9 +2,13 @@
#{set title:'Usage stats'/}
#{set usageStats:'active'/}
-<div class="charts"></div>
+<link rel="stylesheet" href="#{static-path '/public/css/nv.d3.css' /}">
+
+<div class="charts">
+</div>
#{set 'script'}
-<script type="text/javascript" src="https://www.google.com/jsapi"></script>
+<script type="text/javascript" src="#{static-path '/public/js/d3.v2.js' /}"></script>
+<script type="text/javascript" src="#{static-path '/public/js/nv.d3.js' /}"></script>
<script type="text/javascript" src="#{static-path '/public/js/usageStats.js' /}"></script>
#{/set}
@@ -82,7 +82,11 @@
<script type="text/template" id="stats-chart">
<div class="row">
<div class="span12">
- <div class="chart {{scope}} {{column}}"></div>
+ <h3>Scope: {{scope}} Value: {{column}}</h3>
+ <div class="chart {{scope}} {{column}}">
+ <svg></svg>
+ </div>
+ <hr>
</div>
</div>
</script>
Oops, something went wrong.

0 comments on commit 7bade5d

Please sign in to comment.