HighChart的饼图标签不会均匀分布在图表和附近下载的图像问题

时间:2015-07-23 22:59:52

标签: javascript html css charts highcharts

我希望我的标签在我的图表周围均匀分布,但由于某种原因它们保持对齐。我检查了Chrome中的元素,除了其中一个元素之外的所有元素都处于距左侧大约25px的绝对位置。此外,当我下载当前显示的图像时,图像显示看似重叠的标签。这在网页上是不可见的,我不确定它们在图像中的原因。这是我的代码和图像。 enter image description here

var chart2 = new Highcharts.Chart({
                    chart: {
                        type: 'pie',
                        plotBorderColor: '#0574AC',
                        borderWidth: .5,
                        options3d: {
                            enabled: true,
                            alpha: 55,
                            beta: 0
                        },
                        renderTo: 'buRequests',
                        plotShadow: false
                    },
                    credits: {
                        enabled: false
                    },
                    title: {
                        text: 'YTD Requests by ATO'
                    },
                    tooltip: {
                        pointFormat: '{point.y}' + ' Requests' + '<br>' + '{point.percentage:1.0f}%'
                            //percentageDecimals: 1
                    },
                    plotOptions: {
                        pie: {
                            allowPointSelect: false,
                            cursor: 'pointer',
                            depth: 35,
                            dataLabels: {

                                softConnector: true,
                                useHTML: true,
                                enabled: true,
                                fontWeight: 'medium',
                                //format: '{point.name}'+ '<br>' + '{point.y}' +' Requests' + '<br>' + '{point.percentage:1.0f}%',
                                formatter: function() {
                                    var req;
                                    if (this.point.y === 1) {
                                        req = " Request";
                                    } else {
                                        req = " Requests";
                                    }
                                    return '<span style="color:' + this.point.color + '">' + this.point.name + '<br>' + this.point.y + req + '<br>' + Math.round(this.percentage) + '%' + '</span>';
                                }
                            }
                        }
                    },
                    series: [{
                        type: 'pie',
                        name: 'BU Count',
                        data: chartData,
                        colors: ['#F9B112', '#EB6E00', '#42C5F1', '#0472A9', '#C1D52C', '#4AA70A']
                    }],
               });

0 个答案:

没有答案