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

178
Vistas
Trouble in plotting a candlestick chart plotly javascript

I am new at HTML and JAVASCRIPT, I am trying to plot a candlestick chart, loading data from python, send it to javascript trough eel module. the picture shows the console.log of [data] required to plot. the plot doesn't show. when i set X close high low open manually it works. can any one show me wath's wrong?

console.log

var X = [];
var Op = [];
var Hi = [];
var Lo = [];
var Clo = [];
rows = eel.test("SOLUSDT", "1w")();
rows.then(value => value.map(function(row) {
                X.push(new Date(row[0]))}));
rows.then(value => value.map(function(row) {
                Op.push(parseFloat(row[1]))}));
rows.then(value => value.map(function(row) {
                Hi.push(parseFloat(row[2]))}));
rows.then(value => value.map(function(row) {
                Lo.push(parseFloat(row[3]))}));
rows.then(value => value.map(function(row) {
                Clo.push(parseFloat(row[4]))}));
var trace = {
              //x: X,
              close: Clo,
              high: Hi,
              low: Lo,
              open: Op,


              // cutomise colors
              increasing: {line: {color: 'black'}},
              decreasing: {line: {color: 'red'}},

              type: 'candlestick',
              xaxis: 'x',
              yaxis: 'y'
            };


 var data = [trace];
            console.log(data)

            var layout = {
              dragmode: 'zoom',
              showlegend: false,
              xaxis: {
                rangeslider: {
                     visible: true
                 }
              }
            };

   Plotly.newPlot('athrjy', data, layout);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think the problem comes from here, but still can't find out the solution. I can't access array's elements. console.log(relay[0]) outputs "undifined". the picture shows the console.

console

var i = 0
rows.then(value => value.map(function(row) {
                relay[i] = parseFloat(row[4]);
                console.log(relay[i])
                i +=1;
              }));

console.log(relay[0])
about 4 years ago · Juan Pablo Isaza Denunciar
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