简体   繁体   中英

Highcharts: Delete legend displayed only on chart and keep bottom legend

How can i do to delete only the legend displayed on chart, and keep the legend in bottom of my chart ?

在此处输入图片说明

Highcharts.chart('operatingSystemReleaseChart', {
                chart: {
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false,
                    type: 'pie',
                    margin: [0, 0, 40, 0],
                    spacingTop: 0,
                    spacingBottom: 0,
                    spacingLeft: 0,
                    spacingRight: 0,
                },
                credits: {
                    enabled: false
                },
                exporting: {
                    enabled: false
                },
                title: {
                  text: ""
                },
                tooltip: {
                    shared: false,
                    borderRadius: 3,
                    borderWidth: 0,
                    shadow: false,
                    enabled: true,
                    backgroundColor: 'none',
                    useHTML: true,
                    formatter: function () {
                        return '<div class="tooltipHC"><div>'+this.point.name+'</div>' +
                               '<div>Total:<b class="pull-right">'+this.y+'</b></div>' +
                               '<div>Total(%):<b class="pull-right">'+Highcharts.numberFormat(this.percentage)+' %</b></div></div>';
                    }
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        size: "100%",
                        dataLabels: {
                            enabled: true,
                        },
                        showInLegend: true,
                        borderWidth: 0
                    }
                },
                series: [{
                    name: 'Total',
                    colorByPoint: true,
                    data: arrayForPieChart
                }]
            });

In plotOptions.pie , make sure dataLabels property enabled is set to false .

Here's an example - https://codepen.io/Inlesco/pen/EXLPVb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM