可通过设置label的position属性来将标签值显示在柱状图内部,代码示例如下:
import { ColumnChart } from '@opd/g2plot-react';
const data = [{ x: 'A', y: 10 }, { x: 'B', y: 20 }, { x: 'C', y: 30 }];
const config = { data, xField: 'x', yField: 'y', label: { position: 'middle', // 设置标签值在柱状图内部显示 }, };