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

144
Views
highlight one value in plotly.js boxplot

I have a plotly boxplot chart with array of many values and all works well, but I want to highlight one value.

this is my code

var ebitda_margin_plotly = {
                      x: data.plotly_data.ebitda_margin,
                      type: 'box',
                      name: 'E-MARGIN',
                      marker: {
                      color: 'rgba(255, 202, 3, 0.7)',
                      outliercolor: 'rgba(219, 64, 82, 0.6)',
                      line: {
                        outliercolor: 'rgba(219, 64, 82, 1.0)',
                        outlierwidth: 2
                      }
                    },
                    boxpoints: 'suspectedoutliers'
                    };

                    var ebitda_margin_config = {
                    responsive: true,
                    modeBarButtonsToRemove: ['pan2d','select2d','lasso2d','resetScale2d'],
                    displaylogo: false,
                    autosizable: true

                    }
                     var layout_ebitda_margin = {
                      title: ('EBITDA MARGIN: ' + data.data.ebitda_margin + "%")
                    };
Plotly.newPlot('ebitda_margin_plotly', [ebitda_margin_plotly], layout_ebitda_margin,ebitda_margin_config);

how can I add line like this blue which will represent my custom value ? in thiscase 11.7% I have from backend

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

ok I found a solution, which is actually pretty simple

just need to add to layout shapes

var layout_ebitda_margin = {
                      title: "EBITDA MARGIN",
                      height: 320,
                      xaxis: {
                        rangeslider: {}
                                  },
                    yaxis: {
                      showticklabels: false,
                        fixedrange: true
                    },
                    hovermode: 'y unified',
                    shapes: [
                  {
                      type: 'line',
                      x0: data.data.ebitda_margin,
                      y0: -1,
                      x1: data.data.ebitda_margin,
                      y1: 1,
                      line:{
                          color: 'rgb(255, 0, 0)',
                          width: 1,
                          dash:'dot'
                      }} ]
                    };
about 4 years ago · Juan Pablo Isaza Report
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!