Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

171
Visualizações
How to use lines instead of bars in tradingview

Im using tradingview charting library and providing own data with JS API. After getting data from a server, I run the following inside the "getBars"-function:

const data = fetch_data_from_an_api();
let bars = [];
data.Data.forEach(bar => {
    if (bar.time >= from && bar.time < to) {
        bars = [...bars, {
            time: bar.time * 1000,
            low: bar.low,
            high: bar.high,
            open: bar.open,
            close: bar.close,
        }];
    }
});
onHistoryCallback(bars, {
    noData: false,
});

Each element in the array can look like this:

time: 1459814400,
close: 424.53,
high: 425,
low: 419.61,
open: 420.01,
volumefrom: 7219.7,
volumeto: 3052754.53,
conversionType: "force_direct",
conversionSymbol: ""

This draws bars in the widget. But they are "candles", because there is "close, open, low, high". In my case, I have my own data (the data above is fetched from another example-api) which only contains the "close". So the bars don't make sense in my graph. I want to draw lines instead of having bars. I attach here how it looks like when there are bars:

Widget with bars

And I attach here how it looks like when I have the same value for "close, open, low, high". As you can see it only prints some kind of dots, but they do not form a line. I also tried to only put the "close" in the array of bars, but then the graph becomes empty.

Wished lines

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda