高图蜘蛛网更多类别

Highchart spider web more categories

本文关键字:蜘蛛网 高图      更新时间:2023-09-26

我对高图表有问题 - 蜘蛛网。图表效果很好,但是当我想添加更多类别时,我遇到了问题。现在我有 8 个类别,但我想要更多,甚至可能是 100 - 150。是否有可能使用此图表实现此目的?下面是我的图表

    $(function () {
    $('#genrechart').highcharts({
        chart: {
            polar: true,
            type: 'line',
            margin: 0
        },
        exporting: {
            enabled: false,
            buttons: {
                enabled: false
            }
        },
        title: {
            text: '&nbsp',
            x: -80,
            useHTML: true
        },
        pane: {
            size: '70%'
        },
        xAxis: {
            categories: ['Sales', 'Marketing', 'Development', 'Customer Support', 'Information Technology', 'Administration', 'bororo', 'text-center', 'fere'],
            tickmarkPlacement: 'on',
            lineWidth: 0,
            labels: {
                align: 'center',
                distance: 2
            }
        },
        yAxis: {
            gridLineInterpolation: 'polygon',
            lineWidth: 0,
            min: 0,
            endOnTick: true,
            showLastLabel: true,
            tickPositions: [0, 5, 6, 7, 8]
        },
        tooltip: {
            shared: true,
            headerFormat: '<span style="font-size: 12px">{point.key}:</span>&nbsp;&nbsp;<b>{point.y:,.2f}</b>',
            pointFormat: '',
            useHTML: true
        },
        legend: {
            enabled: false,
            align: 'right',
            verticalAlign: 'top',
            y: 70,
            layout: 'vertical'
        },
        series: [{
            name: '',
            data: [1, 2, 3, 4, 5, 6, 7],
            pointPlacement: 'on'
        }]
    });
});

http://jsfiddle.net/sanczopan/qybn6m2u/

谢谢你的帮助。

如果您愿意,可以添加数百个类别,但如果系列数据数组中没有足够的值,则不会显示它们。因此,如果要向图表添加类别,则序列数据数组和类别数组必须具有相同的长度才能显示所有类别。如果没有值,只需添加 null 或 0,但这是必需的。

也许最好不要使用类别。

http://jsfiddle.net/qybn6m2u/3/

$(function () {
    $('#container').highcharts({
        chart: {
            polar: true,
            type: 'line',
            margin: 0
        },
        exporting: {
            enabled: false,
            buttons: {
                enabled: false
            }
        },
        title: {
            text: '&nbsp',
            x: -80,
            useHTML: true
        },
        pane: {
            size: '70%'
        },
        xAxis: {
            tickmarkPlacement: 'on',
            lineWidth: 0,
            labels: {
                align: 'center',
                distance: 20
            }
        },
        yAxis: {
            gridLineInterpolation: 'polygon',
            lineWidth: 0,
            min: 0,
            endOnTick: true,
            showLastLabel: true,
            tickPositions: [0, 5, 6, 7, 8]
        },
        tooltip: {
            shared: true,
            headerFormat: '<span style="font-size: 12px">{point.key}:</span>&nbsp;&nbsp;<b>{point.y:,.2f}</b>',
            pointFormat: '',
            useHTML: true
        },
        legend: {
            enabled: false,
            align: 'right',
            verticalAlign: 'top',
            y: 70,
            layout: 'vertical'
        },
        series: [{
            name: '',
            data: [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4],
            pointPlacement: 'on'
        }]
    });
});

无论如何,具有数百个类别的蜘蛛网图似乎不是数据可视化的很好选择,但我真的不知道您要实现什么,所以我想没关系。

和平!