aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/public_body_controller.rb3
-rw-r--r--app/models/public_body.rb6
2 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 494e19353..da80356f3 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -270,7 +270,8 @@ class PublicBodyController < ApplicationController
data['public_bodies'].each_with_index { |pb, i|
data_to_draw['x_values'].push i
data_to_draw['x_ticks'].push [i, pb['name']]
- data_to_draw['tooltips'].push pb['name']
+ tooltip = "#{pb['name']} (#{data_to_draw['totals'][i]})"
+ data_to_draw['tooltips'].push tooltip
}
@graph_list.push data_to_draw
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index ac2daf279..dcff761e2 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -668,7 +668,8 @@ class PublicBody < ActiveRecord::Base
return {
'public_bodies' => public_bodies,
'y_values' => y_values,
- 'y_max' => y_values.max}
+ 'y_max' => y_values.max,
+ 'totals' => y_values}
end
# Return data for the 'n' public bodies with the highest (or
@@ -711,7 +712,8 @@ class PublicBody < ActiveRecord::Base
'y_values' => y_values,
'cis_below' => cis_below,
'cis_above' => cis_above,
- 'y_max' => 100}
+ 'y_max' => 100,
+ 'totals' => original_totals}
end
private