Stig Johansen wrote:
> Og hvis du er til SVG, findes der færdige kommandoer til den slags.
> Det er desværre en del år siden jeg lavede netop denne slags, men så vidt
> jeg husker kan du klare det med ganske få kommandoer.
>
> (der var noget tricky med cirkeludsnit > 180 grader)
Og jeg fandt lige noget gammelt jeg lavede engang.
Det består langt hen ad vejen af en template med nogle ganske få database
genererede data.
Eksempel:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg width="100%" height="100%" viewBox="0 0 1400 1400">
<style type="text/css">
text.tover {font-family:'Arial';font-size:64;fill:#000000;
font-style:normal; font-weight:bold; text-anchor:middle}
text.uri {font-family:'Arial';font-size:18;fill:#000000; font-style:normal;
font-weight:bold; text-anchor:middle}
text.interval {font-family:'Arial';font-size:36;fill:#000000;
font-style:normal; font-weight:bold; text-anchor:middle}
text.detail {font-family:'Arial';font-size:24;fill:#000000;
font-style:normal; font-weight:bold}
path.OK {fill:green;stroke:black;stroke-width:2}
path.Warning {fill:yellow;stroke:black;stroke-width:2}
path.NotOKHTTP {fill:red;stroke:black;stroke-width:2}
path.NotOKSocket {fill:blue;stroke:black;stroke-width:2}
</style>
<defs>
<linearGradient id="grad001" gradientTransform="rotate(90)">
<stop offset="0" stop-color="#CBFEFF"/>
<stop offset="0.26" stop-color="#C4F1FF"/>
<stop offset="0.764" stop-color="#A0A9FF"/>
<stop offset="1" stop-color="#9999FF"/>
</linearGradient>
</defs>
<g id="Page_1">
<!-- baggrunden -->
<rect x="0" y="0" style="fill:url(#grad001);stroke:none" width="1400"
height="1400"/>
<!-- linie om baggrunden -->
<rect x="0" y="0" style="fill:none;stroke:#000000;stroke-width:1"
width="1400" height="1400"/>
<!-- Overskrift -->
<text x="700" y="80" id="over" class="tover">Monitor statistics by
URI</text>
<text x="700" y="140" id="URI"
class="uri">
http://isb.oio.dk/repository/
<text x="700" y="240" id="intervalstart" class="interval">Measure interval
from 07/01/2003 - 07:00:00</text>
<text x="700" y="300" id="intervalend" class="interval">Measure interval to
10/01/2003 - 18:00:00</text>
<text x="700" y="360" id="intervalcount" class="interval">Measure interval
count 452</text>
<rect x="250" y="1200" style="fill:green;stroke:#000000;stroke-width:1"
width="20" height="20"/>
<text x="280" y="1220" id="OK" class="detail">Response OK</text>
<rect x="250" y="1250" style="fill:yellow;stroke:#000000;stroke-width:1"
width="20" height="20"/>
<text x="280" y="1270" id="Warn" class="detail">Response OK, above
responsetime</text>
<rect x="850" y="1200" style="fill:red;stroke:#000000;stroke-width:1"
width="20" height="20"/>
<text x="880" y="1220" id="NotOK" class="detail">Response NOT OK
(HTTP)</text>
<rect x="850" y="1250" style="fill:blue;stroke:#000000;stroke-width:1"
width="20" height="20"/>
<text x="880" y="1270" id="NotOKSock" class="detail">Response NOT OK
(IP)</text>
</g>
<g id="PieParent">
<desc>Pie chart is built within this 'g' element</desc>
<path d="M700,800 L1000,800 A300,300 0 1,0 663,1098z" class="OK"/><text
x="601" y="688" class="detail">73.0%</text><path d="M700,800 L663,1098
A300,300 0 0,0 725,1099z" class="Warning"/><text x="697" y="950"
class="detail">3.3%</text><path d="M700,800 L725,1099 A300,300 0 0,0
1000,800z" class="NotOKHTTP"/><text x="810" y="902"
class="detail">23.7%</text></g>
</svg>
--
Med venlig hilsen
Stig Johansen