plotly / plotly/plotly.js

Grouped bar chart leaves gaps when some traces have no values for an x-axis tick

Aperta
#7,546 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature P3
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

I’m trying to create a grouped bar chart with multiple traces (e.g., 5). For certain x-axis ticks, not all traces have values. When a trace has no value for a tick, Plotly currently leaves an empty space in the group, which creates unwanted gaps in the bars. Additionally, when the last trace is missing, the bars can look not centered, which makes the chart visually misleading.

Proposed behavior:
If only 4 traces out of 5 have data for a given x-axis tick, Plotly should render just 4 bars side by side without reserving space for the missing trace. This would make grouped bars more compact and visually accurate.

Note that this is the same problem as in this closed issue that was never resolved: https://github.com/plotly/plotly.js/issues/930

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci un grafico a barre raggruppate con cinque serie, in cui una o più serie non abbiano valori in corrispondenza di determinate tacche dell’asse x, e confronta il risultato con il comportamento descritto nell’issue chiusa #930. La modifica è completa quando le serie mancanti non riservano più spazi vuoti e le barre rimanenti restano visivamente centrate all’interno di ogni gruppo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.