plotly / plotly/angular-plotly.js
Issue with Legend Not Adjusting when dynamically adding a new y-axis.
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 242
- Forks
- 81
- Merge moyen
- 8 h 48 min
- PR mergées (30 j)
- 18
Description
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?

Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le template Angular et la disposition du composant présentés dans l’issue, puis comparez l’ajout dynamique de l’axe y avec l’exemple CodePen lié. Reproduisez le graphique avec yaxis2 ajoutée et déterminez la configuration pertinente de legend ou de layout ; le travail est considéré comme terminé lorsque la légende ne chevauche plus le titre du nouvel axe y.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100