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

182
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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