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

295
Views
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
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!