Search code examples
lightweight-charts

How to remove the price line in light-weight-chart?


I have implemented tradingview's lightweight chart in my app, and the chart looks like this. There is a dotted horizontal line for the last price.

Is it possible to hide the horizontal line?


Solution

  • When creating the series, you can set the priceLineVisible option to false to disable that line.

    const mainSeries = chart.addLineSeries({
        priceLineVisible: false,
    });
    

    Documentation: https://tradingview.github.io/lightweight-charts/docs/api/interfaces/SeriesOptionsCommon#pricelinevisible