将地物标签添加到创建echarts图的四分块后,工具提示中的文本将变为未对齐.这似乎是最近才提出的一个问题.
以下是一个没有地物标签的示例,并且工具提示正确呈现:
---
title: "test"
date: "`r Sys.Date()`"
---
```{r}
df <- data.frame(
group = c("Group A", "Group A", "Group B", "Group B", "Group C", "Group C"),
category = c("really really long catgegory", "medium category", "short", "really really long catgegory", "medium category", "short"),
value = c(3, 20, 43, 5, 82, 32)
)
# Create an echarts plot
df |>
dplyr::group_by(category) |>
echarts4r::e_chart(group) |>
echarts4r::e_bar(value, stack = "stacked") |>
echarts4r::e_tooltip(trigger = "axis")
```
以下是一个带有地物标签的示例,该标签会导致工具提示格式发生更改:
---
title: "test"
date: "`r Sys.Date()`"
---
```{r}
#| label: fig-1
df <- data.frame(
group = c("Group A", "Group A", "Group B", "Group B", "Group C", "Group C"),
category = c("really really long catgegory", "medium category", "short", "really really long catgegory", "medium category", "short"),
value = c(3, 20, 43, 5, 82, 32)
)
# Create an echarts plot
df |>
dplyr::group_by(category) |>
echarts4r::e_chart(group) |>
echarts4r::e_bar(value, stack = "stacked") |>
echarts4r::e_tooltip(trigger = "axis")
```
这是四重奏中的一个错误吗?有没有办法确保工具提示文本即使在添加地物标签时也是左对齐的?