echarts4r
echarts4r copied to clipboard
Why does the line disappear when it is gray40?
Hi guys,
I noticed a curious event that I reproduce below:
# I create the data
data_eg <- data.frame(
week = 1:10,
n_cases = c(NA, 2, 4, NA, 5, 3, 6, NA, 7, 2)
)
# this works
data_eg |>
echarts4r::e_charts(week) |>
echarts4r::e_line(
serie = n_cases,
symbol = "none",
color = "#242424"
) |>
echarts4r::e_tooltip(trigger = "axis")
# nope
data_eg |>
echarts4r::e_charts(week) |>
echarts4r::e_line(
serie = n_cases,
symbol = "none",
color = "gray40"
) |>
echarts4r::e_tooltip(trigger = "axis")
It took me a while to understand why the line disappeared and then it was the color. Why? :anguished::anguished::anguished:
gray40 is not a color, you need to pass a valid web color or a valid hex color, e.g.: #000 for black.