Fix off-by-one error in pie chart data

A pie chart with exactly 10 contexts would show up with 9 contexts +
(other).
This commit is contained in:
Katrina Owen 2013-03-17 16:20:12 -06:00
parent d0a12a7010
commit 119e536a97

View file

@ -355,7 +355,7 @@ class StatsController < ApplicationController
'id' => all_actions_per_context[i][:id]
} }
if size==pie_cutoff
if all_actions_per_context.size > pie_cutoff
@actions_per_context[size-1]['name']=t('stats.other_actions_label')
@actions_per_context[size-1]['total']=@actions_per_context[size-1]['total']
@actions_per_context[size-1]['id']=-1