如果饼图中有长数据标签,并且我们将样式宽度设置为100px(以便没有迷你饼图),则某些数据标签将消失,例如,请参见其他值1。
如何解决这个问题?
http://jsfiddle.net/htwh3rdh/4/

$(function () {
    $('#container').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Browser market shares at a specific website, 2014'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    format: '<b style="width: 100px; display: block;">{point.name}</b>: {point.percentage:.1f} %',
                    style: {
                        width: '100px',
                    },
                }
            }
        },
        series: [{
            type: 'pie',
            name: 'Browser share',
            data: [
                ['Firefox',   45.0],
                ['IE',       40],
                ['Safari veryveryveryvery long label',    8.5],
                ['Opera veryveryveryvery long label',     6.2],
                ['Others veryveryveryvery long label',   0.7],
                ['Safari1 veryveryveryvery long label',    2.5],
                ['Opera1 veryveryveryvery long label',     3.2],
                ['Others1 veryveryveryvery long label',   0.6]
            ]
        }]
    });
});

最佳答案

在这些情况下(以我的经验)(长名称和小图形)最好使用具有此类图例的饼图。这样你就不会有名字显示的问题。
JSFIDDLE

$(function () {

    $(document).ready(function () {

        // Build the chart
        $('#container').highcharts({
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: 'Browser market shares at a specific website, 2014'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: false
                    },
                    showInLegend: true
                }
            },
            series: [{
                type: 'pie',
                name: 'Browser share',
                data: [
                    ['Firefox iuyguiygiuygiuygiuy uygiuygiuyg',   45.0],
                    ['IE',       26.8],
                    {
                        name: 'Chrome uygiuygiuyg ',
                        y: 12.8,
                        sliced: true,
                        selected: true
                    },
                    ['Safariiuyg iuygiuyg',    8.5],
                    ['Opera uiy giu y giuy',     6.2],
                    ['Others iuygiuygiuyg',   0.7]
                ]
            }]
        });
    });

});

10-08 02:12