score:1
Accepted answer
You would need to filter the data before initializing the chart like so:
var data = [{
name: 'Year 1800',
data: [0, 0, 0, 0, 0]
}, {
name: 'Year 1900',
data: [0, 156, 947, 408, 6]
}, {
name: 'Year 2008',
data: [0, 914, 4054, 732, 34]
}];
data = $.grep(data, function (category) {
return $.grep(category.data, function (item) {
return item > 0;
}).length > 0;
});
score:1
The problem is that when you would like to dynamically remove categories (by setting them by setCategories function) you also should take care about elements in data series. In other words, when you would like to modify categories, you should also remove data points. Will be better to prepare data without zero, before you use data in highcharts.
Source: stackoverflow.com
Related Query
- Highcharts Bar Graph Remove Category when all bar values for category equal 0
- remove gap below highcharts area chart when all values are zero
- Highcharts displaying white space for bars when all values are zero
- stacked bar chart shows hanging zeros when all values are 0 highcharts
- Highcharts Line - When Y axis min is set to 0, connecting line isn't shown for consecutive 0 values
- Show all labels in highcharts horizontal bar graph
- Highcharts Backgroundimage for bar graph
- Highcharts won't draw line when series values are all 0
- How to remove decimal values on x-axis of bar chart : Highcharts
- Graph issue when y-axis has only '0' as values in highcharts
- Need a single border for stacked bar graph in Highcharts
- How to achieve linear gradient for bar graph in highcharts
- Highcharts - Stack Graph Display Average of all values
- Highcharts - Show a string category label in the tooltip for a line graph
- Hide columns on Stacked Bar when all values are 0
- bar not displayed in Highcharts for Higher values
- How can I put xAxis in highcharts starting in the horizontal line when all values are in 0?
- Highcharts graph remove existing ticks in interval on a category (x-axis)
- Bar chart label alignment for all the zero values
- after using for loop all my column graphs are plotted in single color i need each bar in different color in highcharts
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- Highcharts bar graph doesn't show yaxis values
- dataLabels for bar chart in Highcharts not displaying for null values in 3.0.8
- How to remove space between highChart bar graph between two different category
- HighCharts remove $ and % symbols from custom html table when creating graph
- how to display total count of all the bar values at the top- Highcharts colum- react highhcharts
- In highCharts so much space left for each category when using index with data
- Highcharts - stack values for same category
- Showing all values on one point on x axis and changing range for rCharts highcharts
- Highcharts Pie chart: how to hide the legend for all but the three highest values
More Query from same tag
- Highcharts - show decimal places only if needed
- Export image with phantom - Navigator or credits cannot be changed
- Multiple series highstock live chart
- Showing multiple lines for one series in Highcharts
- Export multiple charts with one request
- Highcharts column range dataLabels reversed
- Highcharts - hidden axis affects performance on redraw
- Highcharts single row stacked horizontal bar: labels overlap --- bar segments too small to read "dataLabels" --- (change "distance" of "dataLabels"?)
- Why HighChart hangs browser?
- Highcharts can't render a bubble chart with a single series
- How to display averages in highcharts?
- Highcharts will not render if element in series data is empty
- Is there any way to fill bubbles partially in highcharts bubble chart?
- How to add box shadow for highchart chart?
- Highcharts bubble chart dataLabels overlapping
- Higstock add all series dynamically
- How to show two specific data points from tabular data in Highcharts?
- Highcharts Column Zones
- Fixing/discounting a data series when changing chart-type in Highcharts
- Highchart Axis Update/ chart redraw
- Highchart.js and AngularJS after navigation some chart does not load
- How can I use chart tooltip formatter in react-highcharts?
- Drill down function in highcharts in case of line charts
- Highchart legend based on unique series/names
- Highcharts / JavaScript month is incompatible with MySQL
- Not all Tooltips and crosshairs not fading from synchronised charts when the mouse leaves a chart
- How to conserve the highchart graph locally?
- Highcharts: Dynamically change axis on legendItemClick
- highcharts datetime x-axis custom formatting
- stacked column highchart custom modifications