Is there a way to automatically adjust the space when a column is hidden by clicking on the legend item?
<div id="container" style="height: 300px"></div>
<script src="http://code.highcharts.com/highcharts.src.js"></script>
var chart = new Highcharts.Chart({
chart: {
type: 'column',
renderTo: 'container'
},
"title":{
"text":"TITLE",
"align":"left"
},
"subtitle":{
"text":"Subtitle Text",
"align":"left",
"style":{
"paddingBottom":"20px"
}
},
"xAxis":{
"categories":[
"Category1",
"Category2",
"Category3",
"Category4",
"Category5"
],
"crosshair":true,
"title":{
},
"labels":{
"enabled":false,
"format":"{value}"
}
},
"yAxis":{
"min":0,
"title":{
"text":"Meters"
},
"labels":{
"format":"{value}"
}
},
"tooltip":{
"enabled":true,
"headerFormat":"<span style=\"font-size:10px\">{point.key}</span><br/>",
"shared":true,
"useHTML":true
},
"legend":{
"enabled":true,
"align":"left",
"useHTML":true
},
"plotOptions":{
"column":{
"pointPadding":0.2,
"borderWidth":0,
"dataLabels":{
"enabled":true,
"format":"{point.y:.2f} ",
"style":{
"textShadow":0
}
}
},
"series":{
"grouping":false
}
},
"series":[
{
"name":"Category1",
"data":[
{
"name":"Category1",
"y":45,
"x":0
}
]
},
{
"name":"Category2",
"data":[
{
"name":"Category2",
"y":43,
"x":1
}
]
},
{
"name":"Category3",
"data":[
{
"name":"Category3",
"y":43,
"x":2
}
]
},
{
"name":"Category4",
"data":[
{
"name":"Category4",
"y":42,
"x":3
}
]
},
{
"name":"Category5",
"data":[
{
"name":"Category5",
"y":42,
"x":4
}
]
},
{
"name":"",
"data":[
{
}
],
"visible":false,
"showInLegend":false,
"exporting":false
},
{
"name":"Bla bla bla",
"data":[
45,
43,
43,
42,
42
],
"showInLegend":false,
"visible":false,
"exporting":true
}
],
"exporting":{
"enabled":false,
"chartOptions":{
"legend":{
"enabled":true,
"maxHeight":null,
"itemStyle":{
"fontFamily":"Arial"
}
}
}
},
"loading":{
"style":{
"opacity":0.9
}
},
"drilldown":{
"drillUpButton":{
"theme":{
"style":{
"display":"none"
}
}
}
}
});
Check out the live example here.
After clicking on the first or last legend item, the chart redraws, but this doesn't occur when clicking on a middle legend item. Is this a bug or a feature? How can I modify this behavior so that clicking on middle legend items also triggers a chart redraw?
Thank you in advance