尽管z-index,Highcharts气泡图数据标签重叠

时间:2015-02-20 09:21:36

标签: highcharts labels overlapping bubble-chart

我的气泡图有问题。实际上,我有一些点具有相同的坐标,具有不同的名称,并且可能具有不同的大小(z点)。对于这些点,我有标签的叠加。 z-index解决方案不起作用(https://stackoverflow.com/questions/15843238/highcharts-bubble-chart-datalabels-overlappinghttps://stackoverflow.com/questions/15843238/highcharts-bubble-chart-datalabels-overlapping)。

有谁知道这个问题的任何解决方案?

我想像饼图一样做标签连接器,但我不知道怎么做。

我的代码:

$(function () {
    $('#container').highcharts({
        credits: {
            enabled: false
        },
        chart: {
            type: 'bubble',
            zoomType: 'xy'
        },
        title: {
            text: ''
        },
        subtitle: {
            text: ''
        },
        xAxis: {
                    categories:['R0', 'R1', 'R2','R3', 'R4', 'R5', 'R6']
        },
        yAxis: {
            title: {
                text: ''
            }
        },
        plotOptions: {
                    bubble: {
                        dataLabels: {
                            enabled: true,
                            useHTML: true,
                            //inside: false,
                            //y:-10,
                            //overflow: false,
                            //crop: false,
                            style: { textShadow: 'none',fontSize: '10px',color:'black' },
                            formatter: function() {
                                return "<i>" + this.point.name.split(' ').join('<br>') + "</i>";
                            }
                        },
                        tooltip : {
                                            headerFormat: '<b>{series.name}</b><br>',
                                            pointFormat : 'S : <i>{point.name}</i><br>Y : {point.y}<br>Num : {point.z}'

                                        }
                    }
                },
        series: [
            {
            name:  'Sample1',
            marker: { fillColor: '#89A54E' },
            data: [
            { name:'A',x:2,y:0.0,z:47},
            { name:'Z',x:3,y:1.0,z:35},
            { name:'E',x:4,y:0.5,z:9},
            { name:'R',x:0,y:1.0,z:34},
            { name:'T',x:3,y:0.0,z:37},
            { name:'T',x:2,y:0.0,z:22},
            { name:'p',x:0,y:1.0,z:39},
            { name:'m',x:2,y:0.5,z:47},
            { name:'h',x:0,y:0.5,z:48},
            { name:'l',x:5,y:1.0,z:25},
            ]
            },
            {
            name:  'Sample2',
            marker: { fillColor: '#92A8CD' },
            data: [
            { name:'AB',x:2,y:0.5,z:23},
            { name:'CA',x:6,y:0.5,z:19},
            { name:'OP',x:3,y:0.5,z:21},
            { name:'CP',x:1,y:0.75,z:38},
            { name:'TS',x:3,y:1.0,z:13},
            { name:'SP',x:0,y:1.0,z:43},
            { name:'SE',x:4,y:1.0,z:2},
            { name:'CS',x:6,y:0.5,z:48},
            { name:'CL',x:1,y:0.5,z:5},
            { name:'H',x:1,y:0.0,z:11},
            ]
            }
        ]
    });
});

0 个答案:

没有答案