I like to set dynamically the value of the minPointLengh for high chart. But the below mentioned code is not working. can you please help me to get it done.
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
xAxis: {
categories: ['Sep', 'Oct', 'Nov', 'Dec']
},
plotOptions: {
var minPointLength;
if(this.y > 0)
minPointLength = 3,
else
minPointLength = 0,
series: {
minPointLength: minPointLength,
}
},
series: [{
data: [4, 0, 1, 5]
}]
});
});
The solution shared by @jlbriggs works fine, but it also removes data from tooltips.
I took similar approach, but instead of making them null, I simply converted
0
values to-1
and setmin
inyAxis
as1
. And also showed0
for values<0
in tooltip.