我发现很难从柱形图中删除基线。这是我的代码。
import { Column } from '@ant-design/plots';
const config = {
data: [...dataArr, ...data],
isStack: true,
xField: 'year',
yField: 'value',
seriesField: 'type',
colorField: 'type', // or seriesField in some cases
color: ['#d62728', '#2ca02c', '#000000'],
yAxis: {
grid: {
line: null
}
},
xAxis: {
grid: {
closed: false,
alignTick: false,
line: null
}
},
label: {
position: 'middle' // 'top', 'bottom', 'middle'
},
interactions: [
{
type: 'active-region',
enable: false
}
],
connectedArea: {
style: (oldStyle) => {
return {
fill: 'rgba(0,0,0,0.2)',
stroke: oldStyle.fill,
lineWidth: 1
};
}
}
};
return <Column style={{ background: 'rgb(27, 27, 27)', padding: '20px 0 20px 20px' }} {...config} />;
};
我尝试了https://charts.ant.design/en/api/plots/column中的文档。 但还是没找到解决办法