From d7716f6e80cceabfc9a574a67e58f9534b5780ba Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Sat, 25 Jun 2016 18:26:36 -0400 Subject: [PATCH] small stylistic changes to default TopNew SVG --- Util.php | 15 ++++++++++++++- cms_chart.php | 10 +++++----- index.html | 1 + 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 index.html diff --git a/Util.php b/Util.php index 719544d..798dfdd 100644 --- a/Util.php +++ b/Util.php @@ -21,5 +21,18 @@ class Util { # foreach ($result->items as $item) { } return $result; } -} + public static function median($arr) { + sort($arr); + $count = count($arr); //total numbers in array + $middleval = floor(($count-1)/2); // find the middle value, or the lowest middle value + if($count % 2) { // odd number, middle is the median + $median = $arr[$middleval]; + } else { // even number, calculate avg of 2 medians + $low = $arr[$middleval]; + $high = $arr[$middleval+1]; + $median = (($low+$high)/2); + } + return $median; + } +} diff --git a/cms_chart.php b/cms_chart.php index 771597e..1305fff 100644 --- a/cms_chart.php +++ b/cms_chart.php @@ -610,8 +610,8 @@ function cms_chart_line($data, $color, $zoom, $xVal, $yVal0, $valShow, $valAngle if ($valShow) $dot .= cms_chart_val($valAngle, $x, $y - 15, 0, 0, cms_chart_axis_format($v, $yFormat)); } echo "\n" . ' '; - echo "\n" . ' '; - echo $dot; + echo "\n" . ' '; +// echo $dot; echo "\n" . ' '; } } @@ -651,9 +651,9 @@ function cms_chart_css($css, $style) { if ($css) echo '