Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!