aboutsummaryrefslogtreecommitdiffstats
path: root/public/javascripts/stats-graphs.js
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-08-19 12:43:16 +0100
committerMark Longair <mhl@pobox.com>2013-08-20 12:11:45 +0100
commit493c1a270b02bf1cd6030e56babefcca89a81595 (patch)
tree074b980a8e8a9e50cd19cb6ba768a880b36c10ef /public/javascripts/stats-graphs.js
parentc8220c5592528463de2f553091d9c0678f12d509 (diff)
Refactor calculation of statistics
Move the calculation of statistics on public bodies into the PublicBody model, so that there's less logic in the controller.
Diffstat (limited to 'public/javascripts/stats-graphs.js')
-rw-r--r--public/javascripts/stats-graphs.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/public/javascripts/stats-graphs.js b/public/javascripts/stats-graphs.js
index 9d9ac5b9d..73e19a6fc 100644
--- a/public/javascripts/stats-graphs.js
+++ b/public/javascripts/stats-graphs.js
@@ -13,6 +13,11 @@ $(document).ready(function() {
graph_data,
graph_div = $('#' + graph_id);
+ if (!graph_data.x_values) {
+ /* Then there's no data for this graph */
+ return true;
+ }
+
graph_div.css('width', '700px');
graph_div.css('height', '400px');