highcharts 在R中使用highcharteR包如何改变背景色?

xu3bshqb  于 2023-02-08  发布在  Highcharts
关注(0)|答案(1)|浏览(149)

这是我用R

library(tidyverse)
library(highcharter)
library(gapminder)

hchart(gapminder::gapminder,
       "column",
       backgroundColor = 'red',
       
       hcaes(x = year, y = lifeExp, size = pop),
       colorByPoint = TRUE)

我在这里检查了backgroundColor Highcharts Doc,它看起来是改变背景颜色的正确方法,但它不起作用。
有人帮忙吗?

r1zk6ea1

r1zk6ea11#

hc <- hchart(gapminder::gapminder,
       "column",
       hcaes(x = year, y = lifeExp, size = pop),
       colorByPoint = TRUE)

hc |> hc_add_theme(hc_theme(chart = list(backgroundColor = 'red')))

相关问题