- commit
- c1e9e0f
- parent
- a33be0e
- author
- Neale Pickett
- date
- 2023-03-11 16:51:15 -0700 MST
Fiddling with display
2 files changed,
+11,
-2
+3,
-1
1@@ -10,8 +10,10 @@ html, body {
2 margin: 0;
3 }
4 #pie canvas {
5- max-width: 50px;
6+ max-width: 20vw;
7+ max-height: 20vh;
8 position: absolute;
9+ opacity: 90%;
10 }
11 #area canvas {
12 width: 100vw;
+8,
-1
1@@ -108,7 +108,7 @@ class PieChart extends Chart{
2
3 this.ctx.fillStyle = this.colors[i]
4 this.ctx.beginPath()
5- this.ctx.arc(0, 0, this.r, θ, θ + angle, false)
6+ this.ctx.arc(0, 0, this.r, θ, θ + angle)
7 this.ctx.lineTo(0, 0)
8 this.ctx.fill()
9
10@@ -126,6 +126,13 @@ class PieChart extends Chart{
11 }
12 θ += angle
13 }
14+ // Put a border around it
15+ this.ctx.strokeStyle = "silver"
16+ this.ctx.lineWidth = 5
17+ this.ctx.beginPath()
18+ this.ctx.arc(0, 0, this.r - this.ctx.lineWidth/2, 0, τ)
19+ this.ctx.stroke()
20+
21 this.ctx.restore()
22 }
23 }