diff --git a/static/chart.js b/static/chart.js index c250311..1a2e082 100644 --- a/static/chart.js +++ b/static/chart.js @@ -157,6 +157,7 @@ class FibLevelsPrimitive { for (const item of this._items) { if (item.kind === 'rail') { ctx.strokeStyle = item.color; + ctx.fillStyle = item.color; ctx.lineWidth = item.width; ctx.setLineDash([]); ctx.globalAlpha = 0.85; @@ -164,6 +165,13 @@ class FibLevelsPrimitive { ctx.moveTo(item.x + 0.5, item.y0); ctx.lineTo(item.x + 0.5, item.y1); ctx.stroke(); + ctx.save(); + ctx.translate(item.x, (item.y0 + item.y1) / 2); + ctx.rotate(-Math.PI / 2); + ctx.textAlign = 'center'; + ctx.textBaseline = item.x > 14 ? 'bottom' : 'top'; + ctx.fillText('fibonacci', 0, item.x > 14 ? -2 : 2); + ctx.restore(); continue; } const start = item.x0 == null ? 0 : Math.max(0, item.x0);