apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.69k stars 19.62k forks source link

[Bug] axisPointer label alignment wrong when using rich text #20523

Open geertplaisier opened 2 days ago

geertplaisier commented 2 days ago

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

- OS:
- Browser:
- Framework:

Any additional comments?

No response