0
A
回答
0
您可以使用HTML5 Canvas繪製線條和圓圈。
〔實施例:
function drawCircle(ctx, x, y, r){
ctx.beginPath();
ctx.arc(x,y,r,0,2*Math.PI);
ctx.fillStyle = 'white';
ctx.fill();
ctx.stroke();
}
function drawLine(ctx, fromX, fromY, toX, toY){
ctx.moveTo(fromX,fromY);
ctx.lineTo(toX,toY);
ctx.stroke();
}
function drawCircleAndLine(ctx, fromX, fromY, toX, toY, r){
\t drawLine(ctx, fromX, fromY, toX, toY);
\t drawCircle(ctx, fromX, fromY, r);
drawCircle(ctx, toX, toY, r);
}
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
//Defines your node here
drawCircleAndLine(ctx, 300, 100, 400, 200, 40);
drawCircleAndLine(ctx, 300, 100, 200, 200, 40);
drawCircleAndLine(ctx, 400, 200, 500, 300, 40);
drawCircleAndLine(ctx, 200, 200, 100, 300, 40);
<canvas id="myCanvas" width="600" height="400" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
0
margin-left: 100px;
height: 109px;
background-color: red;
width: 3px;
-ms-transform: rotate(20deg);
/* -webkit-transform: rotate(20deg); */
transform: rotate(29deg);
+0
雖然此代碼段可以解決的問題,[包括一個解釋](http://meta.stackexchange.com/問題/ 114762 /解釋 - 完全基於代碼的答案)確實有助於提高帖子的質量。請記住,您將來會爲讀者回答問題,而這些人可能不知道您的代碼建議的原因。 –
相關問題
- 1. 使用c製作金字塔#
- 2. 如何製作金字塔python那樣..?
- 3. 如何在Java中使用astersik製作金字塔?
- 4. 金字塔連接池大小
- 5. 金字塔PostgreSQL的連接問題
- 6. 金字塔滑塊JavaScript
- 7. 金字塔的add_static_view如何工作?
- 8. 在金字塔中使用金字塔認證
- 9. 如何訪問金字塔視圖之外的MongoDB連接?
- 10. 繪製垂直金字塔
- 11. 如何在three.js r68中製作一個矩形金字塔?
- 12. 金字塔
- 13. 金字塔subrequests
- 14. 使用Javascript連接SVG圈子
- 15. 連接到MongoDB的(或任何其他數據庫服務器)與金字塔
- 16. 金字塔網絡應用程序中的Rabbitmq連接管理?
- 17. CSS步驟連接圈
- 18. 何時使用金字塔中的route_url或route_path?
- 19. 使用python,如何使用for循環創建金字塔?
- 20. Javascript金字塔名稱顯示
- 21. 金字塔:簡單或變形?
- 22. SQL建模金字塔或二叉樹
- 23. 金字塔pserve比/
- 24. 使用setw建立一個金字塔
- 25. 打印金字塔使用遞歸僅
- 26. 使用芹菜與金字塔和mod_wsgi
- 27. 多線程requests.post使用uWSGI,金字塔
- 28. python unicode csv使用金字塔導出
- 29. D3:數據連接的人口金字塔
- 30. SQLAlchemy核心+金字塔不關閉連接
感謝它的工作.. – Shahnawaz