I’m building a candlestick chart with preset of price data. By default it is set to two decimals 0.01
of price. However my price data ranges way past from 0.01 to 0.0000002 etc. I was searching docs for property to customize default value of two deciamals to lesser range of numbers. In the docs it says: “The minimum possible step size for price value movement. This value shouldn’t have more decimal digits than the precision”. Thank you
Here’s my code and chart data
const log = console.log;
const chartProperties = {
width:1200,
height:600,
timeScale:{
timeVisible:true,
secondsVisible:false,
}
}
const domElement = document.getElementById('chart');
const chart = LightweightCharts.createChart(domElement,chartProperties);
const candleSeries = chart.addCandlestickSeries();
fetch(`http://localhost:8888/trade/tok-btc/chart/dataset.txt`)
.then(res => res.json())
.then(data => {
const cdata = data.map(d => {
return {time:d[0]/1000,open:parseFloat(d[1]),high:parseFloat(d[2]),low:parseFloat(d[3]),close:parseFloat(d[4])}
});
candleSeries.setData(cdata);
})
.catch(err => log(err));
[
[1640060100000,"0.004","0.008","0.002","0.0055",1640060159999],[1640060160000,"0.0055","0.008","0.002","0.005",1640060219999],[1640078220000,"0.005","0.008","0.002","0.0045",1640078279000],[1640078280000,"0.0045","0.0065","0.0043","0.0058",1640078339000]
]