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

153
Visualizações
Hide a specific legend only from FusionChart

How to hide a specific legend from multi-series fusionChart. Actually I want to remove a specific series from chart, when exporting I need to show that on excel sheet. So my plan is initial time hide from the chart then remove that legend from legend section.

I have used 'initiallyhidden' => 1, property, that time it will not shown in the chart. Now I want to remove that series name from legend also.

JSFiddle: http://jsfiddle.net/oL2u3vbd/1/

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

0

You can manipulate the categories within the datasource and dynamically change the chart's datasource when readying to export to excel. You just have to make sure to revert the change so it doesn't affect the visible chart.

document.getElementById("export").addEventListener("click", function() {
  // december 2013 isn't shown but is included in excel export
  let oldDataCategories = [...fusionData.dataSource.categories[0].category]
  
  // Add Dec back to the categories && export
  fusionData.dataSource.categories[0].category.push({ label: "Dec 2013" });
  FusionCharts("myChartId").setChartData(fusionData.dataSource, 'json');
  FusionCharts("myChartId").exportChart({ exportFormat: "csv" })
  
  //revert categories back
  fusionData.dataSource.categories[0].category = oldDataCategories;
  console.log(fusionData.dataSource.categories[0].category)
  FusionCharts("myChartId").setChartData(fusionData.dataSource, 'json');
});

Here is a example, You'll see there's not series for Dec. 2013 on the chart but when you export it that data is included.

https://jsfiddle.net/xv3ps9b5/3/

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