2016-11-13 147 views
0

我正在繪製一個關於無線電信號的簡單路徑。在y上只能提供0或1,x是延遲納秒。svg路徑繪製不正確

<!DOCTYPE> 
 
<html> 
 
\t <head> 
 
\t \t <title>GPIO TEST</title> 
 
\t \t <style> 
 
\t \t \t html, body 
 
\t \t \t { 
 
\t \t \t \t width:100%; 
 
\t \t \t \t height: 100%; 
 
\t \t \t \t margin: 0; 
 
\t \t \t \t padding: 0; 
 
\t \t \t \t box-sizing: border-box; 
 
\t \t \t } 
 
\t \t </style> 
 
\t </head> 
 
\t <body> 
 
\t \t <svg width="100%" height="50%" style="border:1px solid #000;" viewBox="0 -0.2 384071041 1.2" version="1.1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"> 
 
\t \t \t <path d="M 0 0 v 1 h 26379904 v 1 h 41916258 v 1 h 58997548 v 1 h 73918928 v 0 h 88221334 v 1 h 99886849 v 0 h 116664152 v 1 h 132164508 v 1 h 147551869 v 0 h 164463167 v 0 h 179546540 v 0 h 192406006 v 0 h 206892404 v 1 h 220718829 v 0 h 236095190 v 1 h 251343557 v 0 h 266534925 v 1 h 282160276 v 0 h 293355811 v 0 h 306647258 v 1 h 322362605 v 1 h 336254028 v 1 h 352724344 v 1 h 369630641 v 0 h 384071041" fill="none" stroke="#000" stroke-width="0.001"></path> 
 
\t \t </svg> 
 
\t </body> 
 
</html>

我試圖改變筆劃寬度在任何可能的數目,但結果是不一致的。

結果應該是這樣的: enter image description here

回答

0

我剛剛注意到,我應該已經用於水平線和垂直的「V」的「H」,因爲我只拿到了絕對座標,而不是dx(delta X)和dy(delta Y)。

由於MDN說:H x (or h dx V y (or v dy)