plotly / plotly/angular-plotly.js
Issue with Legend Not Adjusting when dynamically adding a new y-axis.
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 242
- Fork
- 81
- Merge medio
- 8h 48m
- PR unite (30g)
- 18
Descrizione
Hi, I am currently facing issues adjusting the legend of a plot when a new trace with a new y-axis is added to the plot.
Somehow the legend seems to be overlayed on the newly added y-axis title.
This is my current code set-up:
Angular Template:
<plotly-plot #plotlygraph [style]="{position: 'relative', width: '100%', height: '100%'}"
[useResizeHandler]="true"></plotly-plot>
Angular Component:
// Initial Layout
layout = {
title: 'Anomaly Plot',
autosize: true,
xaxis: {
autorange: true,
type: 'date',
title: { text: 'DateTime' },
},
yaxis: {
autorange: true,
type: 'linear',
title: { text: '°C' },
},
};
// Add new trace with a new y-axis
layout[yaxis2] = {
autorange: true,
type: 'linear',
side: 'right',
title: { text: 'mA' },
};
According to this example here the legend seems to have been adjusted automatically without any further configuration.
Is there a configuration am missing? if not, how can I achieve adjusting the label not to overlay the newly added y-axis?

Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con il template Angular e il layout del componente mostrati nell’issue, quindi confronta l’aggiunta dinamica dell’asse y con l’esempio CodePen collegato. Riproduci il grafico con la yaxis2 aggiunta e determina la configurazione rilevante di legend o layout; il lavoro è completato quando la legenda non si sovrappone più al titolo dell’asse y appena aggiunto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100