有人使用过Highchart漏斗用于Angular吗?

我使用highchart-ng(https://github.com/pablojim/highcharts-ng),但无法进行漏斗。

我使用ng-highchart的代码是:

$scope.chartSalesFunnel = {
    options: {
        chart: {
            type: 'funnel',
            marginRight: 100
        },
        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b> ({point.y:,.0f})',
                    color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
                    softConnector: true
                },
                neckWidth: '30%',
                neckHeight: '25%'

                //-- Other available options
                // height: pixels or percent
                // width: pixels or percent
            }
        },
    },
    title: {
        text: '',
    },

    legend: {
        enabled: false
    },
    series: [{
        name: 'Unique users',
        data: [
            ['Website visits', 15654],
            ['Downloads', 4064],
            ['Requested price list', 1987],
            ['Invoice sent', 976],
            ['Finalized', 846]
        ]
    }]
};

最佳答案

漏斗图类型需要额外的漏斗模块,如in the API所述。

您可以像这样包含它:

<script src="https://code.highcharts.com/modules/funnel.js"></script>


请参见包含此模块的代码的this updated JSFiddle

关于javascript - Highchart漏斗漏斗,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36209492/

10-10 04:23