简体   繁体   中英

Number of price tick marks in TradingView Lightweight Charts

In some situations, TradingView Lightweight Charts draws too few tick marks on the price scale (ie: too few horizontal grid lines). Is there any way to control the number/density of tick marks?

In the example below, only two horizontal tick marks are drawn, even when the chart is rendered quite a bit bigger. It would be good if it drew twice as many horizontal grid lines in this instance:

Found the answer. Key here is do change precision/minMove as follows:

            candleSeries.applyOptions({
                priceFormat: {
                    type: 'custom',
                    minMove: 0.00000001,
                    formatter: price => parseFloat(price).toFixed(8),
                },
            });

Documentation: https://github.com/tradingview/lightweight-charts/blob/master/docs/series-basics.md#price-format

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM