apache / apache/echarts

[Bug] axisPointer label alignment wrong when using rich text

Open
#20,523 0 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.5.1

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqM2gHUqAlXIAWClQDEOEFQGVmphdFoBdPqViNceADKMARlQA2RVPfQAzTgBbZhYOIgAKADdGTyUASgQAPmI_Ugh_WGjYpQR4RFozMFpE3zTSDiowBQ44WiQ3YE8BKjwwAB8igF9aAG5-Py6B-0rq2tgYuKp-tK67PyN6bR9h0kbm1rAV8tJA6DB1CFZtLdl1zVX0IdmBuYHHfAAFYAh9qnDUvzxtYAB3IjAHCU83sFGodG-jAEf14q087i823KgQ4ITAYUijA4rES8BSZR2GSyWNYADpJrl8gUiiVPjt0KManUGk0BJ1mD0ZvTrvTGeMSeSctNLrA7jtFss6eVzkj6bA9gcqEcTnRzrQRVcRTz7NrRSQxbByDh8LKyJQaLIKcp9fM8O8IK0xAMCaQhGARLBRABGABMAAYeLB_QHYF6AKwhgAcIYA7CGvV74wBmP22VZgi20NxY9U6kjWFBdXpAA

### Steps to Reproduce

Use an axisPointer with rich text the alignment for the tooltip is incorrect. Without rich text the label is aligned in the center, when using rich text, the alignment is incorrect.

For example, use:

```
formatter: arg => ['{bold|', arg.value, '}'].join(''),
rich: {
bold: {
fontWeight: 'bold'
}
}
```

### Current Behavior

axisPointer label with rich text alignment is incorrect

### Expected Behavior

When using rich text the alignment should be the same as without

### Environment

```markdown
- OS:
- Browser:
- Framework:
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.