Highcharts.js:漏斗的定制

Highcharts.js:漏斗的定制,highcharts,Highcharts,我用这个脚本制作了一个漏斗 $(function () { $('#container').highcharts({ chart: { type: 'funnel', marginRight: 100 }, title: { text: 'Sales funnel', x: -50 }, plotOptions:

我用这个脚本制作了一个漏斗

$(function () {

    $('#container').highcharts({
        chart: {
            type: 'funnel',
            marginRight: 100
        },
        title: {
            text: 'Sales funnel',
            x: -50
        },
        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b> ({point.y:,.0f})',
                    color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
                    softConnector: false
                },
                neckWidth: '2%',
                neckHeight: '0%',

                //-- Other available options
                //height: pixels or percent
                width: '100%'
            }
        },
        legend: {
            enabled: false
        },
        series: [{
            name: 'Unique users',
            data: [
                ['Item 1',   15005],
                ['Item 2',       1681],
                ['Item 3', 1254],
                ['Item 4',    1165],
                ['Item 5',    800],
                ['Item 6',    60],
                ['Item 7',    202],
            ]
        }]
    });
});
$(函数(){
$(“#容器”)。高图({
图表:{
类型:'漏斗',
marginRight:100
},
标题:{
文本:“销售漏斗”,
x:-50
},
打印选项:{
系列:{
数据标签:{
启用:对,
格式:“{point.name}({point.y:,.0f})”,
颜色:(Highcharts.theme&&Highcharts.theme.ContractTextColor)| |“黑色”,
软连接器:错误
},
领口宽度:“2%”,
颈部高度:“0%”,
//--其他可用选项
//高度:像素或百分比
宽度:“100%”
}
},
图例:{
已启用:false
},
系列:[{
名称:“唯一用户”,
数据:[
['项目1',15005],
[‘项目2’,1681],
['项目3',1254],
['项目4',1165],
['项目5',800],
['项目6',60],
[项目7',202],
]
}]
});
});

如果有可能的话,可以这样看吗? 每个条的高度相等,只有宽度取决于值


感谢您的帮助。

Highcharts API中没有制作该图表的函数。漏斗型图表的宽度只有一个从锥形到直形的变化

相反,您可以尝试使用区域范围类型图表。 JSFiddle:


这很好。但是我更喜欢倒装:false。
$(function () {
    $('#container').highcharts({

        chart: {
            type: 'arearange',
            inverted: true,
            zoomType: 'x'
        },
        legend: {
            enabled: false
        },

        series: [{
            data: [{low:-100, high:100, x: 0},{low:-50, high:50, x: 1}]
        },{
            data: [{low:-50, high:50, x: 1},{low:-40, high:40, x: 3}]
        },{
            data: [{low:-40, high:40, x: 3},{low:0, high:0, x: 4}]
        }]
    });
});