有没有办法让我的 Highcharts 在 y 轴和工具提示上有一个千位分隔符?不确定是否有单独的方法来执行此操作,或者是否有全局选项。工具提示数据点已格式化,因此在逗号所在的位置有一个空格。我在谷歌上搜索了很多,只是想不通。感谢您的帮助。
代码:
hc <- jobs %>% hchart(
'line', hcaes(x = new_time, y = employment), color = "#34657F") %>%
hc_title(
text = "Virginia",
align="left",
style = list(fontFamily = "Montserrat")) %>%
hc_subtitle(text= "Employment (in thousands) since March 2018 <br>",
align="left",
style = list(fontFamily = "Montserrat")) %>%
hc_xAxis(title = list(enabled = FALSE)) %>%
hc_yAxis(title = list(enabled = FALSE)) %>%
hc_chart(style = list(fontFamily = "Open Sans"))
hc
谢谢!
最佳答案
作者jbkunst提供的包this answer here :
library(highcharter)
library(magrittr)
# set options
hcoptslang <- getOption("highcharter.lang")
hcoptslang$thousandsSep <- ","
options(highcharter.lang = hcoptslang)
# plot with commas
highchart() %>%
hc_add_series(data = round(rnorm(100)*10000))
关于R highcharter()全局千位分隔符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67624380/