antvis / antvis/G2Plot

🤔 [QUESTION]条形图无法展示图表标题

Open
#3,713 0 comments 0 reactions 0 assignees View on GitHub
Question
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

## 给条形图配置title后,无法展示

### 图表配置
`
import { Bar } from '@ant-design/plots';

const Chart = ({ dataSource }) => {
const config = {
xField: 'value',
yField: 'label',
color: ({ label }: Record) => {
if (label === '收入') {
return '#F34B45';
}
if (label === '支出') {
return '#2EA223';
}
return '#5254CC';
},
title: {
visible: true,
text: '年度累计(万元)',
},
tooltip: {
title: '年度累计(万元)',
showTitle: true,
},
};

return (




);
};
export default Chart;
`
### 展示截图
image

### 期望效果
标题正常展示

* **G2Plot Version**: @ant-design/plots 1.2.6

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the Bar component, the shown title configuration, and @ant-design/plots 1.2.6. Trace how the title option is handled and verify that the chart title renders as expected without breaking the tooltip behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.