Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda