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

297
Vistas
Dar formato a la anotación Plotly correctamente

Estoy mostrando anotaciones al hacer clic en un gráfico gráfico. Ahora me gustaría alinear las líneas para que se vean mejor. Las sangrías deben ser las mismas para cada línea. Viene claro con la imagen: ingrese la descripción de la imagen aquí

 myPlot.on('plotly_click', function (data) { var point = data.points[0], newAnnotation = { x: point.x, y: point.y, arrowhead: 7, ax: 0, ay: 80, bgcolor: 'rgba(255, 255, 255, 0.85)', arrowcolor: point.fullData.marker.color, font: { size: 12 }, bordercolor: point.fullData.marker.color, borderwidth: 2, text: ' | <b>Messung: </b> ' + vitSigTitle + ' |<br>' + '---- <br>'+ '<b>Zeitpunkt </b><br>' + (new Date(point.x)).toLocaleString('default')+ '<br>'+ '<i>Jahr: </i> ' + (new Date(point.x)).getFullYear() + '<br>' + '<i>Monat: </i> ' + (new Date(point.x)).toLocaleString('default', { month: 'long' }) + '<br>' + '<i>Tag: </i> ' + (new Date(point.x)).toLocaleDateString('default', { weekday: 'long' }) + '<br>' + '<i>Uhrzeit: </i> '+ (new Date(point.x)).toLocaleTimeString() + '<br>' + '<b>Messwert</b><br>' + (point.y) + vitSigUnit }, newIndex = (node.children[0].layout.annotations || []).length; // delete instead if clicked twice if (newIndex) { var foundCopy = false; node.children[0].layout.annotations.forEach(function (ann, sameIndex) { if (ann.text === newAnnotation.text) { Plotly.relayout(node.children[0], 'annotations[' + sameIndex + ']', 'remove'); foundCopy = true; } }); if (foundCopy) return; }

Como puede ver, "Etiqueta" está completamente desplazada.

Aquí está mi código:

about 4 years ago · Juan Pablo Isaza
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