I have my legend aligned with my data series, so I don't want the little sample bit of line/symbol to show next to the legend item.
symbolWidth:0 obviously removes the symbool, but I'm still left with a few pixels of line.
I've looked in the reference guide and can't find any options to adjust this, which seems odd, am I missing something obvious?
You can hide it simply using css.
This worked for me
Square and circle:
.highcharts-legend-item rect{
display:none;
}
Line :
.highcharts-legend-item path {
display: none;
}
You can hide the symbols using legend options:
legend: {
symbolPadding: 0,
symbolWidth: 0,
symbolHeight: 0,
squareSymbol: false
},
Highcharts.chart('container', {
legend: {
symbolPadding: 0,
symbolWidth: 0,
symbolHeight: 0,
squareSymbol: false
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
type: 'column',
data: [95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1]
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
Example: https://jsfiddle.net/BlackLabel/b04woedh/1/
One workout is by giving .001 to hide symbol
legend: {
symbolHeight: .001,
symbolWidth: .001,
symbolRadius: .001
},
jsfiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With