plotly / plotly/angular-plotly.js
Issue with Legend Not Adjusting when dynamically adding a new y-axis.
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- TypeScript
- Estrelas
- 242
- Forks
- 81
- Merge médio
- 8h 48min
- PRs com merge (30d)
- 18
Descrição
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?

Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece com o template Angular e o layout do componente mostrados na issue e, em seguida, compare a adição dinâmica do eixo y com o exemplo do CodePen vinculado. Reproduza o gráfico com a yaxis2 adicionada e determine a configuração relevante de legend ou layout; considera-se concluído quando a legenda não se sobrepuser mais ao título do eixo y recém-adicionado.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- angular, typescript
- Domínio
- frontend
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100