I am drawing some lines to visualize the time of long/short position.
My goal is to position label (P&L text) **to the left border of the chart**.
My goal is to position label (P&L text) **to the left border of the chart**.
const chart = createChart(chartContainerRef.current, {
layout: {
background: { type: ColorType.Solid, color: 'transparent' },
textColor: '#333',
},
grid: {
vertLines: { color: '#444' },
horzLines: { color: '#444' },
},
width: chartContainerRef.current.clientWidth,
height: 400,
timeScale: {
timeVisible: true,
secondsVisible: false,
},
});
// Create order line
const orderLine = chart.addLineSeries({
color: trade.action === 'LONG' ? '#26a69a' : '#ef5350',
lineWidth: 2,
lineStyle: LineStyle.Solid,
title: `PnL:${pnl?.toFixed(4)}`,
priceScaleId: 'left',
});
Setting priceScaleId
to left
does a trick, but the problem is, left and right have different price scales.
This results in lines being drawn lower or higher than its original position.
How can I have the same price scaling for both left and right, or is there any other solution?
Appreciate your help!