mirror of
https://github.com/seigler/neat-charts
synced 2025-07-27 09:26:10 +00:00
small stylistic changes to default TopNew SVG
This commit is contained in:
parent
c907cfd18c
commit
d7716f6e80
3 changed files with 20 additions and 6 deletions
15
Util.php
15
Util.php
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
1
index.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Under development
|
Loading…
Add table
Add a link
Reference in a new issue