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

182
Visualizações
How can I get access to a Apache ECharts through id of DOM-Container?

I draw many piecharts on the map, at some point in time I need to update those piecharts using setOption. All I found they suggest saving the echart object inside the variable then update base on variables like below:

//Create
let echartsObj = echarts.init(document.getElementById("someId"));
    ...
};
//Update
echartsObj.setOption(option)

But this is not working for me because I have many echart instances and I should match them base on their id like below:

//It is not updating but I want something like that for updating echarts
someFunctionOrInstance("#echartId").setOption(option)

As I know, this approach is doable with other chart libraries like chart.js

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

0

setOption is a method of the object that echarts.init returned, but $("#echartId") returns a jQuery instance.

One option would be to store these into an object, using the ID as key - then you have easy access to them, directly via that.

The other would be to use the echarts.getInstanceByDom method - that does not select by ID directly, but needs to get a div or canvas element passed in, and will then return the correct instance for that element.

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