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

145
Vistas
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 Respuestas
Responde la pregunta

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 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