首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在echarts4r中更改注释文本颜色

在echarts4r中更改注释文本颜色
EN

Stack Overflow用户
提问于 2022-07-06 22:52:45
回答 1查看 86关注 0票数 1

我想改变e_text_g()添加到echarts4r绘图中的文本的颜色。

示例

代码语言:javascript
复制
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")
          )
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-07 03:01:05

如果您只想用e_text_g()更改添加的文本的颜色,则可以通过添加fill参数来做到这一点,

代码语言:javascript
复制
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
    )
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72890642

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档