small stylistic changes to default TopNew SVG

This commit is contained in:
Joshua Seigler 2016-06-25 18:26:36 -04:00
parent c907cfd18c
commit d7716f6e80
3 changed files with 20 additions and 6 deletions

View file

@ -21,5 +21,18 @@ class Util {
# foreach ($result->items as $item) { } # foreach ($result->items as $item) { }
return $result; 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;
}
}

View file

@ -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)); if ($valShow) $dot .= cms_chart_val($valAngle, $x, $y - 15, 0, 0, cms_chart_axis_format($v, $yFormat));
} }
echo "\n" . ' <g fill="#'. $color[$i % $cNum] .'">'; echo "\n" . ' <g fill="#'. $color[$i % $cNum] .'">';
echo "\n" . ' <path d="M'. substr($line, 1) .'" class="line" stroke="#'. $color[$i++ % $cNum] .'"/>'; echo "\n" . ' <path d="M'. substr($line, 1) .'" class="line" stroke-linejoin="round" stroke="#' . $color[$i++ % $cNum] .'"/>';
echo $dot; // echo $dot;
echo "\n" . ' </g>'; echo "\n" . ' </g>';
} }
} }
@ -651,9 +651,9 @@ function cms_chart_css($css, $style) {
if ($css) echo ' if ($css) echo '
<![CDATA[ <![CDATA[
svg.chart{display:block} svg.chart{display:block}
.chart-bg{fill:#eee;opacity:.5} .chart-bg{fill:transparent;opacity:1}
.chart-box{fill:#fff;opacity:1} .chart-box{fill:transparent;opacity:1}
.chart-tick line{stroke:#ddd;stroke-width:1;stroke-dasharray:5,5} .chart-tick line{stroke:#000;stroke-width:1;opacity:0.1}
.chart text{font-family:Helvetica,Arial,Verdana,sans-serif;font-size:12px;fill:#666} .chart text{font-family:Helvetica,Arial,Verdana,sans-serif;font-size:12px;fill:#666}
.axisX text{text-anchor:middle} .axisX text{text-anchor:middle}
.xAngle text{text-anchor:start} .xAngle text{text-anchor:start}

1
index.html Normal file
View file

@ -0,0 +1 @@
Under development