javascripthtmltradingview-apicandlestick-chartohlc

Trading View API is not able to show the price on price-scale when it's small


Check my OHLC Data for Plotting Candlesticks with Trading View API.

I am using this HTML and Script to Plot the Data :

<!DOCTYPE html>
<html>
<head>
    <title>Plot</title>

    <script src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"></script>

</head>
<body>

<script type="text/javascript">
    
const chart = LightweightCharts.createChart(document.body, { width: 1200, height: 600 });
    const lineSeries = chart.addLineSeries();

    chart.applyOptions(
    {
        timeScale: {
            rightOffset: 12,
            timeVisible: true,
            secondsVisible: false,
            fixLeftEdge: false,   
        },

    }

 
    );

let candl_data = [my_OHLC_data]
const candlestickSeries = chart.addCandlestickSeries();

// set data
candlestickSeries.setData(candl_data)



</script>
</body>
</html>

See how it's being show : CandleStciks1

How can I make it to show the Full Price?


Solution

  • Rakesh. Better late than never. You need to specify the price precision in the settings. Demo

    const candlestickSeries = chart.addCandlestickSeries({
        priceFormat: {
          type: 'price',
          precision: 10,
          minMove: 0.0000000001,
        },
    });