Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
Amcharts 4 : Disable single legend item programmatically

I just need to know how to disable a single legend item programmatically on chart reload (disable means: legend is shown greyed out and its linked curve is hidden), as I need to reload a chart with some new data using some back and forward arrows, but still need to remember the user preference or the state of legend items (on/off)

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You can just call hide on the series associated with that legend marker to hide the series/grey out the marker:

series.hide();
about 4 years ago · Juan Pablo Isaza Relatório

0

Thanks @xorspark that's really it, it's about controlling the series not legend.

It happened to work specifically with the appeared or inited events, not shown event as it seemed to be, like this:

series.events.on("inited", () => {
  reactState ? series.show() : series.hide();
});

inited event even works better, as disabled legends will not show a glimpse of their color on the curve when using appeared.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda