• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

236
Vistas
Plotly.js: Any way to resize plots when sidebar is toggled?

I'm using a Bootstrap sidebar for my website with several Plotly graphs. The Plotly is responsive with window size change, but when I toggle the sidebar button on and off the graphs do not adjust properly. Is there a fix to this? Partial code for Plotly listed.

Plotly chart not responsive -- extra space in the border when sidebar toggled off

var layout = {
              xaxis: {
                rangeselector: selectorOptions,
                rangeslider: {}
              },
              yaxis: {
                fixedrange: true,
                side: 'right'
              },
              margin: {
                l: 50,
                r: -50,
                b: 50,
                t: 30,
                pad: 4
              },
                yaxis: {
                  fixedrange: true,
                  side: 'left'
                },
                showlegend: false,
                

              };
              var config = {responsive: true};
almost 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Assuming you know when the sidebar has been toggled, you can call Plotly.Plots.resize(yourPlotlyDiv) afterwards.

almost 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda