Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
细分: '消费者',
销售额: 677302.8919999995,
},
{
地区: '西北',
细分: '公司',
销售额: 253458.1840000001,
},
{
地区: '西北',
细分: '消费者',
销售额: 458058.1039999998,
},
];
const stackBarPlot = new StackBar(document.getElementById('container'), {
forceFit: true,
title: {
visible: true,
text: '百分比堆叠条形图',
},
data,
yField: '地区',
xField: '销售额',
xAxis: {
formatter: (v) => Math.round(v / 10000) + '万',
},
stackField: '细分',
});
stackBarPlot.render();
细分: '公司',
销售额: 253458.1840000001,
},
{
地区: '西北',
细分: '消费者',
销售额: 458058.1039999998,
},
{
地区: '西北',
细分: '小型企业',
销售额: 103523.308,
},
];
const stackBarPlot = new StackBar(document.getElementById('container'), {
forceFit: true,
title: {
visible: true,
text: '堆叠条形图:label自动隐藏',
},
description: {
visible: true,
text:
'在堆叠条形图中,如果label的位置被设定为middle,即显示在条形中间。在对应形状大小不够摆放label的情况下,label会被自动隐藏。',
},
data,
yField: '地区',
xField: '销售额',
xAxis: {
formatter: (v) => Math.round(v / 10000) + '万',
},