Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
Tradingview Lightweight candlestick charts price depth

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'm trying to implement priceFormat property but it doesn't work. Thank you

Here's my code and chart data



const log = console.log;

const chartProperties = {
    width:1200,
    height:600,
    timeScale:{
        timeVisible:true,
        secondsVisible:false,
    },
    priceFormat: {
        type: 'price',
        precision: 6,
        minMove: 0.000001,
    },
}

const domElement = document.getElementById('chart');
const chart = LightweightCharts.createChart(domElement,chartProperties);
const candleSeries = chart.addCandlestickSeries();

fetch(`http://localhost:8888/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]
]
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

From https://github.com/tradingview/lightweight-charts/discussions/697:

To change format of your series' data you need to override price format for your series by changing/applying options.

For example, if you'd like to show 6 digits after a comma you can use the following options:

series.applyOptions({
    priceFormat: {
        type: 'price',
        precision: 6,
        minMove: 0.000001,
    },
});

Also, you can look at this test case for more complete example.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!