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

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

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