I am trying to Make the legend symbol a square or rectangle for a line graph. Example
For rectangular legend we need to set squareSymbol: false
.
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Round legend symbols'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr']
},
legend: {
symbolWidth: 16,
symbolRadius: 0,
squareSymbol: false
},
series: [{
data: [1, 3, 2, 4]
}, {
data: [6, 4, 5, 3]
}, {
data: [2, 7, 6, 5]
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>