I'm using the Tradingview LightWeight Chart library, I would like to draw a vertical line just like the one in the image below, how do I go about it?
I've tried setting the chart to show only one date and activate the grid but I also don't know how to make the chart show only one date. My plan was to make the chart show just one date and activate the grid, that way, I get the vertical Line.
Unfortunately the LightWeight charts don't expose an API for that.
The closest thing you can do is to use the addHistogramSeries
(which is typically used to show volume bars). You will need to set scaleMargins: { top: 0, bottom: 0 }
and that will generate bars with the 100% height. Considering that they can be semi-transparent that will be close enough to a vertical bar.
Check out the screenshot:
The yellow bars are produced using that technique, and btw the blue bars on the top are also created the same way with scaleMargins: { top: 0, bottom: 0.98 }
settings.