Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!