score:1
you can use the load
event to examine series in a loop and hide the ones without any data:
var chart = highcharts.chart('container', {
chart: {
events: {
load: function() {
this.series.foreach(function(s) {
s.update({
showinlegend: s.points.length
});
});
}
}
},
series: [{
data: [1, 2]
}, {
data: [3, 4, 2]
}, {
data: [] // no data
}]
});
live demo: http://jsfiddle.net/kkulig/355u0kaw/
api references:
Source: stackoverflow.com
Related Query
- Highchart - hide name in legend if no data
- HighCharts Hide Series Name from the Legend
- how to hide highchart x - axis data values
- How get data name in Highcharts pie chart legend instead of "Slice" using array of values?
- HighChart hide other series on click legend
- Hide a category when a series name has no value attributed to it highchart
- Dynamically hide or show legend in highchart
- Highchart treemap is not showing numeric data in name field
- Cannot display a legend with special character in highchart from the serie name
- HighChart - accessing series data by category name
- problem Highchart Show/Hide data label on hover legend
- Highchart (pie chart) with data from HTML table not displaying legend
- Can I hide legend name in StackedChart using HighChart?
- Disable highchart legend if series name = 'SP'
- Group data points by third variable and display the group name in legend
- highchart color as classname inside data series doesn't apply to legend
- How to render Gantt Highchart from data source
- Get Value Json Data to series name Highchart
- Legend name and color need to be displayed in the export of highchart as image
- Highchart columnrange, color code lines based on data
- How do I hide the code for the chart data in highcharts?
- Highchart - show / hide an y-Axis without hiding the series
- Highcharts: Hide and show legend
- Highchart hide default buttons
- Reduce gap between series data in Bar Highchart
- creating highchart with ajax json data
- Plot Highchart Gauge with JSON Data
- Highcharts - How to hide series name and Y value in tooltip
- Highchart Legend into another Element (div)
- HighChart Heatmap with JSON data
More Query from same tag
- How to change Highcharts 3D Pie Chart Label and Tooltip Style?
- Highcharts/Highstock DataGrouping & Approximation
- Highcharts tick date formatting
- Highcharts - additional data with Json
- Does Highchart.js not have 'stacked percentage bar' chart
- HighCharts Series Data Structure Issue. JSFiddle link provided
- Javascript relative time 24 hours ago etc as time
- How to extend plot line value outside the grey area or outside the chart in highchart?
- Formatting Highchart bar charts axis labels
- How do I add text to a gauge's ticks?
- How to render a vertical line when the mouse cursor is on the chart using highcharts?
- Sweep animation with highcharts pie
- Chartkick gem, limit group in pie chart and multiple series
- Highcharts Custom Funnel
- Genealogy Chart/Family Tree
- jQuery UI Tabs and Highcharts display/rendering issue
- Set tooltip in date format Highchart
- A different suffix from an array for each line on Highcharts
- How to format data labels with Jquery Highcharttable column charts
- Highchart Duplicate X-Axis and Y-Axis Labels
- Highcharts grouped columns of varying widths that fill the entire space automatically
- Highcharts tooltip custom CSS turning the caret/arrow white
- rHighchart in R Shiny
- multiple charts using highcharts
- customEvents.js and H.removeEvents conflict
- how to add values from a database output to the data field in Line Chart of Chart.js
- Tick Interval for 5 days
- Highcharts selection, yaxis is undefined
- HighCharts data defined in a HTML Table using PHP MySQL
- (Highcharts) Polygon-like shell in polar chart