score:1
Accepted answer
You can add some flag to avoid looping through the first chart.
$.each(Highcharts.charts, function(i, chrt) {
//
// Flag to avoid looping through the first chart
//
if (i !== 0) {
$.each(chrt.series, function(j, serie) {
let tmp_key = serie.name.replace(/[\s,-]/g, '');
if (!Object.keys(listed).includes(tmp_key)) {
legend.append(
'<div class="item ' + tmp_key + '"><div class="symbol" style="background-color:' +
serie.color +
'"></div><div class="serieName" id="">' +
serie.name +
'</div></div>'
);
listed[tmp_key] = [serie];
} else {
listed[tmp_key].push(serie);
}
});
}
});
score:0
A JSFiddle would be nice. Do notice though that
if (serie.visible) serie.setVisible(false);
else serie.setVisible(true);
can be simplified to serie.setVisible(!serie.visible)
Source: stackoverflow.com
Related Query
- How to make Highcharts legends focus on the chart that it belongs to?
- How to make a HighCharts drilldown column/bar chart that does not hide the non-drilldown categories
- How can I make milestone lines with a GANTT chart using the highcharts library?
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- How to display legend in Highcharts Waterfall Chart and make the sum column of waterfall appear in multiple colors?
- How to draw a chart from one array of data and make labels on the chart from another array of data? Highcharts v.4.0.4
- How to make the highcharts generated chart be scalable or responsive
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- HighCharts - Make the pie chart 100% of the div
- How do you increase the performance of highcharts chart creation and rendering
- HighCharts - How to create dynamic chart that exports EVERYTHING
- Highcharts Bar Chart - How to set the minimum bar width/length
- How to make a pie chart from highcharts responsive
- Highcharts Bubble Chart - How to move an individual point's data label (dataLabel) to the front/top
- How to let user know that a Highcharts chart is clickable?
- How To Dynamically Truncate The Y-Axis Title On Chart Resize/Reflow In Highcharts
- highcharts- stacked bar, how can I make the chart cover the width 100%?
- How do I make the label in polar chart not get split automatically?
- Highcharts : How do I keep the marker formatting and make the click event fire with a 5K+ point scatter plot?
- Make highcharts fullscreen also fullscreen the div wrapping the chart
- How to show Legends for all the series data in stacked column chart Highcharts?
- how to display 2 same highcharts without duplicate the code
- How to re-create the same chart in Highcharts as seen on the mock?
- How to update the highcharts.js to make the export server to my own ipaddress,instead of connect to the highcharts server?
- Highcharts Gantt - how to make the horizontal rows / lanes taller?
- Highcharts - how to do a responsive pie chart when the texts of the labels are long
- How to Make a Dashed Bar Chart Border in Highcharts
- Highcharts how to create legends based on the value of points
- How do I make a Tornado Chart using Highcharts
- Highcharts Bubble Chart - How to get the size of the point
More Query from same tag
- Use classic mode instead of styled mode in Highcharts with Angular
- Tooltip doesn't appearing for overlapping datapoints in highchart xrange
- How to Get Highcharts Sparkline to Show Up On My Page.
- HighCharts Tooltip AJAX request onmouseover Event
- HighCharts angular not working with dynamic data from Angular service
- How can I add a div on the left part and this will be showed only on the mouse click?
- highcharts not to fill the width
- Remove the strikethrough on legend symbols for line charts?
- UIWebview not scrolling in jquery part
- Highcharts chart width to dispay size dynamically
- Highcharts - Possible to change the text zoom to other wording?
- HighStock CandleStick type does not printed in Chrome
- How to change the border of the area chart?
- How to allow multiple point selections in Highcharts donut chart?
- Highcharts setData on pie chart not working
- Rotating a donut chart in javascript after it is rendered
- HighStocks series does not show line on Black Colors
- Highcharts.stockChart is not a function
- Highcharts navigation button and fullscreen button in bootstrap
- Highcharts : barchart
- Highcharts error csv.replace is not a function
- Change Highchart's pie chart .xls file category column name
- Highcharts, Mysql, and Codeigniter
- Highcharts range selector date formats from C#
- highchart: How to Remove Series space (after & before)
- Funneling a user input back through and model to render again
- ionic 2 Uncaught (in promise): Error: Highcharts error #17: www.highcharts.com/errors/17
- Highcharts - Export CSV include additional data
- HighCharts add div to series on click
- Javascript syntax when setting a value