VChart icon indicating copy to clipboard operation
VChart copied to clipboard

多层级坐标轴,如何隐藏没有数据的轴标签?

Open webiamcome opened this issue 10 months ago • 2 comments

需求: image

demo: https://codesandbox.io/p/sandbox/muddy-firefly-d7gj2p?file=%2Fsrc%2FBar%2Findex.ts

spec 参数:

const spec = {
    type: 'bar',
    data: {
        values: [
            { "x0": "自然", "x1": "深市", "x2": "2022", "x": "自然-深市-2022", "type": "券商计数", "value": "1" },
            { "x0": "广告", "x1": "深市", "x2": "2022", "x": "广告-深市-2022", "type": "券商计数", "value": "2" },
            { "x0": "Others", "x1": "沪市", "x2": "2022", "x": "Others-沪市-2022", "type": "券商计数", "value": "1" },
            { "x0": "BD", "x1": "沪市", "x2": "2022", "x": "BD-沪市-2022", "type": "券商计数", "value": "2" }
        ]
    },
    xField: ['x2', 'x1', 'x0'],
    yField: 'value',
    seriesField: 'x',
    axes: [
        {
            orient: 'bottom',
            showAllGroupLayers: true,
        }
    ]
}

webiamcome avatar Apr 07 '24 02:04 webiamcome