Make the legend symbol a square or rectangle - Javascript highcharts

Javascript examples for highcharts:Chart Legend

Description

Make the legend symbol a square or rectangle

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {//www  .  j  av a2  s. c  om
    Highcharts.chart('container', {
        chart: {
            type: 'column'
        },
        title: {
            text: 'Square legend symbols'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr']
        },
        legend: {
            symbolRadius: 0
        },
        series: [{
            data: [1, 3, 2, 4]
        }, {
            data: [6, 4, 5, 3]
        }, {
            data: [2, 7, 6, 5]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="container" style="height: 400px"></div>  
   </body>
</html>

Related Tutorials