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

250
Vistas
Plotly.js subplot bar combines all data into one chart

I want to create four bar charts for my three ml models. The front-end receives a data that contains value of four different evaluation metrics for the three models. However, the chart that is showing in the front-end is not working correctly.

Here is the code in JS:

    let len_ = js_vars.selected_ems.length;
    var data = [];
    for (let i = 0; i < js_vars.selected_ems.length; i++) {

        var trace = {
            x: js_vars.models_name,
            y: js_vars.em_vals[i],
            type: 'bar',
            name: js_vars.selected_ems
        };
        data.push(trace)
    }
    console.log(data)


    var layout = {
    grid: {rows:len_, columns: 1,barmode: 'stack',},
    };

    Plotly.newPlot('myDiv', data, layout);

And here is the data that has been logged in the console: enter image description here

But the problem is instead of showing a subplot with 4 rows (different evaluation metrics) and 3 models, it combines all of them into one chart.

enter image description here

How can I solve this?

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