From 18c11746ab90b6d39358646747acbb823f6fed6b Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Thu, 6 Aug 2015 21:39:56 +0100 Subject: Children/family chart fails when average number of children more than 10 --- app/Stats.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/Stats.php') diff --git a/app/Stats.php b/app/Stats.php index af88ff0e40..7e85a05ce1 100644 --- a/app/Stats.php +++ b/app/Stats.php @@ -4933,8 +4933,10 @@ class Stats { $chxl .= $this->centuryName($values['century']) . "|"; if ($max <= 5) { $counts[] = round($values['num'] * 819.2 - 1, 1); - } else { + } elseif ($max <= 10) { $counts[] = round($values['num'] * 409.6, 1); + } else { + $counts[] = round($values['num'] * 204.8, 1); } $chm .= 't' . $values['num'] . ',000000,0,' . $i . ',11,1|'; $i++; @@ -4943,8 +4945,10 @@ class Stats { $chm = substr($chm, 0, -1); if ($max <= 5) { $chxl .= "1:||" . I18N::translate('century') . "|2:|0|1|2|3|4|5|3:||" . I18N::translate('Number of children') . "|"; - } else { + } elseif ($max <= 10) { $chxl .= "1:||" . I18N::translate('century') . "|2:|0|1|2|3|4|5|6|7|8|9|10|3:||" . I18N::translate('Number of children') . "|"; + } else { + $chxl .= "1:||" . I18N::translate('century') . "|2:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|3:||" . I18N::translate('Number of children') . "|"; } return "\"""; -- cgit v1.3