Originally Posted by
lao
Nu, la asta ma refer:
Am modificat aici
Code:
function switch_interval() {\n\
if (interval<=1000) {\n\
interval -= 250;\n\
Am pus 100 in loc de 250 dar nu e deajuns, m-am cam repezit in loc sa citesc mai mult ce e pe acolo
Mai sapam...
1. Seteaza un template directory. Gen /usr/local/etc/tpl
2. Viziteaza http://iport/savetemplates.html
3. Vezi fisierul GRAPH.tpl
4. Sterge totul in afara de GRAPH.TPL (asta daca nu ai chef sa modifici si altceva, binenteles)
Editeaza fisierul si cauta linia:
Code:
<path id='graph_grid' class='graph_grid' d='M 2 75 L 800 75 M 2 150 L 800 150 M 2 225 L 800 225'/>
Ca sa intelegi codul SVG:
M 2 75 L 800 75
M 2 150 L 800 150
M 2 225 L 800 225
Astea sunt cele 3 linii ale tale. E un sistem de coordonate X Y. M inseamna "move to" (du-te la) punctul 2,75. L Inseamna "traseaza o linie de la punctul curent (2,10) pana la 800 cu 75".
Graficul are o dimensiune de 800x300 si 0,0 corespunde coltului stanga-sus.
Deci Y=75 == 750ms, Y=150 == 500ms, Y=225 == 250ms. Deci 75px == 250ms.
Pentru un grid din 100 in 100ms folosim un "pas" de 30 pixeli.
Code:
<path id='graph_grid' class='graph_grid' d='M 2 30 L 800 30 M 2 60 L 800 60 M 2 90 L 800 90 M 2 120 L 800 120 M 2 150 L 800 150 M 2 180 L 800 180 M 2 210 L 800 210 M 2 240 L 800 240 M 2 270 L 800 270'/>
Nu sunt sigur acum cum functioneaza treaba, dar cand timpul de raspuns al unui reader trece de 1000ms, scara se dubleaza, si in loc sa arate de la 0 la 1000ms, va arata de la 0 la 2000, fara a redesena gridul, dar textul (250/500/750ms) se va actualiza cu noile valori (500/1000/1500).
Tine minte ca nu este intotdeauna necesar/recomandat sa editezi codul sursa. In cazul de fata daca editezi template-ul esti mai castigat
---------- Post added at 07:00 ---------- Previous post was at 06:44 ----------
Bun,
Si daca tot ne-am apucat de ceva, hai sa si terminam ca oricum nu am somn.
Hai sa "rezolvam" si "legenda" graficului:
Cautam liniile astea:
Code:
<text id='graph_grid_txt3' class='graph_grid_txt' x='800' y='223'>-</text>
<text id='graph_grid_txt2' class='graph_grid_txt' x='800' y='148'>-</text>
<text id='graph_grid_txt1' class='graph_grid_txt' x='800' y='73'>-</text>
Code:
SVGDoc.getElementById('graph_grid_txt1').firstChild.data = 3*rmax/4 + 'ms'
SVGDoc.getElementById('graph_grid_txt2').firstChild.data = 2*rmax/4 + 'ms';
SVGDoc.getElementById('graph_grid_txt3').firstChild.data = rmax/4 + 'ms';
Si le inlocuim cu astea:
Code:
<text id='graph_grid_txt9' class='graph_grid_txt' x='800' y='268'>-</text>
<text id='graph_grid_txt8' class='graph_grid_txt' x='800' y='238'>-</text>
<text id='graph_grid_txt7' class='graph_grid_txt' x='800' y='208'>-</text>
<text id='graph_grid_txt6' class='graph_grid_txt' x='800' y='178'>-</text>
<text id='graph_grid_txt5' class='graph_grid_txt' x='800' y='148'>-</text>
<text id='graph_grid_txt4' class='graph_grid_txt' x='800' y='118'>-</text>
<text id='graph_grid_txt3' class='graph_grid_txt' x='800' y='88'>-</text>
<text id='graph_grid_txt2' class='graph_grid_txt' x='800' y='58'>-</text>
<text id='graph_grid_txt1' class='graph_grid_txt' x='800' y='28'>-</text>
Code:
SVGDoc.getElementById('graph_grid_txt1').firstChild.data = 9*rmax/10 + 'ms'
SVGDoc.getElementById('graph_grid_txt2').firstChild.data = 8*rmax/10 + 'ms';
SVGDoc.getElementById('graph_grid_txt3').firstChild.data = 7*rmax/10 + 'ms';
SVGDoc.getElementById('graph_grid_txt4').firstChild.data = 6*rmax/10 + 'ms';
SVGDoc.getElementById('graph_grid_txt5').firstChild.data = 5*rmax/10 + 'ms';
SVGDoc.getElementById('graph_grid_txt6').firstChild.data = 4*rmax/10 + 'ms';
SVGDoc.getElementById('graph_grid_txt7').firstChild.data = 3*rmax/10 + 'ms';
SVGDoc.getElementById('graph_grid_txt8').firstChild.data = 2*rmax/10 + 'ms';
SVGDoc.getElementById('graph_grid_txt9').firstChild.data = rmax/10 + 'ms';
Si... gata :-)
Edit: Si fisierul gata facut: http://z.linge-ma.ws/GRAPH.tpl (dati si voi cu Save As...)