1. mattgrande
  2. HamOntFire

Commits

mgr...@redwavecommerce.com  committed 1ff3fb1

Adding new stats

  • Participants
  • Parent commits f9c6c6a
  • Branches default

Comments (1)

Files changed (1)

File HamOntFire.Web/Views/Statistics/Index.cshtml

View file
 
 <div style="clear: both"></div>
 
-@*<h3>Average Number of Units per Event Type</h3>
+<h3>Average Number of Units per Event Type</h3>
 
 <div>
     <div id="container2"></div>
-</div>*@
+</div>
 
 <h3>Heat Map</h3>
 <img src="@Url.Action("HeatMap")" alt="some image" />
 
 <script type="text/javascript">
 var model = @Html.Raw( Model.EventCountByType.ToJson() );
-var categories = [];
 var data = [];
 for (var i = 0; i < model.length; i++) {
     data[i] = [model[i].Name, model[i].Count];
 }
-chart = new Highcharts.Chart({
+var chart = new Highcharts.Chart({
     chart: {
         renderTo: 'container'
     },
     data: data
     }]
 });
+
+var model2 = @Html.Raw( Model.AverageUnitsPerEventType.ToJson() );
+var categories = [];
+var data2 = [];
+for (var i = 0; i < model.length; i++) {
+    categories[i] = model2[i].Name;
+    data2[i] = model2[i].UnitsPerType;
+}
+
+var chart2 = new Highcharts.Chart({
+    chart: {
+        renderTo: 'container2',
+        type: 'column',
+        margin: [50, 50, 50, 50]
+    },
+    title: { text: 'TITLE GOES HERE' },
+    xAxis: {
+        categories: categories,
+    },
+    yAxis: {
+        min: 0,
+        title: { text: 'Avg Units per Event' }
+    },
+    legend: { enabled: false },
+    tooltip: {
+        formatter: function() {
+            return '<b>' + this.x + '</b><br/>' +
+                Highcharts.numberFormat(this.y, 1) + ' units';
+        }
+    },
+    series: [{
+        name: 'Units',
+        data: data2,
+        dataLabels: { enabled: false }
+    }]
+});
 </script>