antvis / antvis/G2Plot

🤔 [QUESTION] Unable to customize the label of X axis. (Radar Chart)

Open
#3,795 2 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

### 🐛 Question description
I want to add a border for the label of X axis in the Radar Chart

### 💻 Link to minimal reproduction

```{JavaScript}
xAxis: {
label: {
style: {
fontFamily: "'Inter', sans-serif",
fontWeight: 500,
fontSize: 20,
fill: "#0C0D21",
border: "1px solid #F1F1F7",
background: "#6a6a6a",
className: styles.xAxisLabel,
},
formatter: (text, item, index) => {
const userAScore = data.find(
(d) => d.item === text && d.user === "User A"
).actualScore;
const userBScore = data.find(
(d) => d.item === text && d.user === "User B"
).actualScore;
return `${text} (A: ${userAScore}, B: ${userBScore})`;
},
useHtml: true,
htmlTemplate: (text) => `

${text}

`,
},
```

```{css}
.xAxisLabel {
border: 3px solid #000 !important;
padding: 2px;
background-color: #fff;
}
```
### 🏞 Expected result
I tried add border using HTML or using className to define. but all failed. I checked the doc, but I did not find an example to support this.
if this is achievable?

* **G2Plot Version**: "@antv/g2plot": "^2.4.31",
* **Platform**: Win11

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Radar Chart xAxis label configuration shown in the issue, including style, useHtml, htmlTemplate, and className. Determine whether bordered labels are supported in G2Plot 2.4.31; done means documenting the supported approach or identifying the required chart behavior and validating it with a minimal reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.