我想改变e_text_g()添加到echarts4r绘图中的文本的颜色。
示例
library(echarts4r)
library(tidyverse)
data(cars)
cars
cars %>% count(speed) %>%
e_chart(speed) %>%
e_bar(n) %>%
e_text_g(style = list(text = c("Text i want like to change to red"), # change the color of the text
fontSize = 20, opacity = .7, color = "red"), left = 75, top = 1) %>%
e_text_style(
color = c("red")
)发布于 2022-07-07 03:01:05
如果您只想用e_text_g()更改添加的文本的颜色,则可以通过添加fill参数来做到这一点,
library(echarts4r)
library(dplyr)
data(cars)
cars %>%
count(speed) %>%
e_chart(speed) %>%
e_bar(n) %>%
e_text_g(
style = list(
text = c("Text i want like to change to red"),
fontSize = 20,
opacity = .7,
fill = "red" # changing color of this text
),
left = 75,
top = 1
)https://stackoverflow.com/questions/72890642
复制相似问题