plotly / plotly/plotly.js

Autoexpand does not work for axes

Offen
#7,266 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

documentation feature P3
Vorherrschende Sprache
JavaScript
Sterne
18.3k
Forks
2k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
28

Beschreibung

Seems like autoexpand does not work (or I do something wrong). In the example below, I increased y axis tick label size and font size, so they consume much more space, but margins are not adjusted, and labels are partially hidden outside of the chart container.

Reproduction

https://codepen.io/shadow-identity/pen/abeQprO

This is slightly modified example from the documentation: https://plotly.com/javascript/line-and-scatter/#line-and-scatter-plot

What is modified:

  • y axis tick values increased to have more symbols
  • y axis tick font size increased
  • I also tested it with explicitly set margin: {autoexpand: true}, but it does not change anything
Expected results

Grid size should be reduced (margin should be added to the left) to keep y axis ticks visible

Actual results

Y axis ticks are partially hidden

Environment

Chrome 130, Firefox 133 beta
Plotly from https://cdn.plot.ly/plotly-2.35.2.min.js

Additional info

At the same time, legend seems to increase corresponding margin. I increased the name length of one of the series to check if it will expand the margin, and it works.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der CodePen-Reproduktion und vergleiche sie mit dem verknüpften Plotly-Dokumentationsbeispiel für Linien- und Streudiagramme unter Verwendung von Plotly 2.35.2. Prüfe, warum vergrößerte y-Achsenbeschriftungen keine Erweiterung des linken Randes auslösen, während die längere Legende dies tut; abgeschlossen ist die Aufgabe, wenn die y-Achsenbeschriftungen vollständig sichtbar bleiben, ohne den Rand manuell festzulegen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.