Add public ranking listing, link charts better
[disclosr.git] / documents / charts.php
blob:a/documents/charts.php -> blob:b/documents/charts.php
--- a/documents/charts.php
+++ b/documents/charts.php
@@ -13,10 +13,10 @@
 ?>
 <div class="foundation-header">
     <h1><a href="about.php">Charts</a></h1>
-    <h4 class="subheader">Lorem ipsum.</h4>
+    <h4 class="subheader"></h4>
 </div>
 <div id="bydate" style="width:1000px;height:300px;"></div>
-<div id="byagency" style="width:1200px;height:300px;"></div>
+<div id="byagency" style="width:1200px;height:800px;"></div>
 <script id="source">
     window.onload = function () {
         $(document).ready(function () {
@@ -59,7 +59,7 @@
                     mode: 'x'
                 },
                 HtmlText: false,
-                title: 'Time'
+                title: 'Disclosure Log entries added by Date'
             };
 
             // Draw graph with default options, overwriting with passed options
@@ -98,12 +98,12 @@
     var agencylabels = [];
     function agencytrackformatter(obj) {
 
-        return agencylabels[Math.floor(obj.x)] + " = " + obj.y;
+        return agencylabels[Math.floor(obj.y)] + " = " + obj.x;
 
     }
     function agencytickformatter(val, axis) {
         if (agencylabels[Math.floor(val)]) {
-            return '<p style="margin-top:8em;-webkit-transform:rotate(-90deg);">' + (agencylabels[Math.floor(val)]) + "</b>";
+            return  (agencylabels[Math.floor(val)]) ;
 
         } else {
             return "";
@@ -117,7 +117,7 @@
             $dataValues = Array();
             $i = 0;
             foreach ($rows as $row) {
-                echo "       d2.push([".$i.", $row->value]);" . PHP_EOL;
+                echo "       d2.push([ $row->value,$i]);" . PHP_EOL;
                 echo "       agencylabels.push(['".str_replace("'","",$idtoname[$row->key])."']);" . PHP_EOL;
 
                 $i++;
@@ -131,9 +131,10 @@
         document.getElementById("byagency"),
         [d2],
         {
+            title: "Disclosure Log entries by Agency",
             bars: {
                 show: true,
-                horizontal: false,
+                horizontal: true,
                 shadowSize: 0,
                 barWidth: 0.5
             },
@@ -143,14 +144,14 @@
                 trackFormatter: agencytrackformatter
             },
             yaxis: {
-                min: 0,
-                autoscaleMargin: 1
-            },
-            xaxis: {
                 minorTickFreq: 1,
                 noTicks: agencylabels.length,
                 showMinorLabels: true,
                 tickFormatter: agencytickformatter
+            },
+            xaxis: {
+                min: 0,
+                autoscaleMargin: 1
             },
             legend: {
                 show: false