陳姿穎javaScript物件canvas繪製選擇權到期日損益
canvas繪圖套件繪製選擇權到期日損益圖
以上繪圖的原始碼
<h1>canvas繪圖套件繪製選擇權到期日損益圖</h1><canvas id="BuyOptions" width="500" height="300"></canvas><script>const c = document.getElementById("BuyOptions");const ctx = c.getContext("2d");ctx.beginPath();ctx.moveTo(0, 0);ctx.lineTo(100, 100);ctx.lineTo(200,100);ctx.font = "16px Arial";ctx.fillText("買入賣權puts的到期日損益",0,120);ctx.moveTo(300, 100);ctx.lineTo(400, 100);ctx.lineTo(500, 0);ctx.fillText("買入買權callss的到期日損益",300,120);ctx.moveTo(0, 300);ctx.lineTo(100, 200);ctx.lineTo(200,200);ctx.font ="30pt";ctx.fillText("賣出賣權puts的到期日損益",0,180);ctx.moveTo(300, 200);ctx.lineTo(400, 200);ctx.lineTo(500, 300);ctx.fillText("賣出買權callss的到期日損益",300,180)ctx.stroke();//繪製</script>
拷貝甲班示範
identifier名稱,身分證id card
wikipedia括號brackets
- 圓括弧(英語:parentheses或英語:round brackets),中文中又稱小括弧、括弧。
- 方括弧(英語:brackets或英語:square brackets),中文中又稱中括弧。
- 半形 :[ ]
- 全形:[ ]
- 花括弧(英語:braces,或英語:curly brackets), 中文中又稱大括弧。
- 半形:{ }
- 全形:{ }
- 角括弧(英語:chevrons或英語:angle brackets),中文中又稱為尖括弧。
- 雙角括弧(英語:double angle brackets),中文中又稱為雙尖括弧。
- 半形:⟪ ⟫
- 全形:《 》,在中文中用作雙書名號
心得
今天所學的內容比之前越來越上手,希望學程式會越來越厲害!
0108補上CANVAS關號等,漸層式背景。https://yiingxxn.blogspot.com/2024/01/javascriptcanvas.html
回覆刪除