diff --git a/static/chart.js b/static/chart.js index 5dd7ef1..ff229f1 100644 --- a/static/chart.js +++ b/static/chart.js @@ -448,7 +448,10 @@ class ConfluenceChart { // The default leaves a tenth of the pane empty beneath the lowest bar, // which is where the volume draws and where a cursor tracing swing lows // naturally sits — far from any actual price. Give most of it back. - this.chart.priceScale('right').applyOptions({ scaleMargins: { top: 0.12, bottom: 0.04 } }); + this.chart.priceScale('right').applyOptions({ + scaleMargins: { top: 0.12, bottom: 0.04 }, + minimumWidth: 72, + }); // Whitespace to the right of the last bar. Lightweight Charts only labels // times that exist on the scale, so the axis under the projection area was // blank — you could watch two trendlines converge and not know when. These @@ -965,7 +968,8 @@ class ConfluenceChart { const chart = this.chartEl.getBoundingClientRect(); const plot = canvas.getBoundingClientRect(); this.currentPriceRight.style.top = `${Math.round(plot.top - chart.top + y - 8)}px`; - this.currentPriceRight.style.left = `${Math.max(0, this.chartEl.clientWidth - 16)}px`; + const scale = Math.round(chart.right - plot.right); + this.currentPriceRight.style.left = `${Math.round(plot.right - chart.left + Math.max(scale, 72) - 14)}px`; } }