Highcharts: Make the legend symbol a square or rectangle

前端 未结 7 1957
盖世英雄少女心
盖世英雄少女心 2020-12-16 15:20

I am trying to Make the legend symbol a square or rectangle for a line graph. Example

\"enter

相关标签:
7条回答
  • 2020-12-16 16:14

    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>

    0 讨论(0)
提交回复
热议问题