echarts4r icon indicating copy to clipboard operation
echarts4r copied to clipboard

Why does the line disappear when it is gray40?

Open denis-or opened this issue 1 year ago • 1 comments

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:

denis-or avatar Dec 12 '24 18:12 denis-or

gray40 is not a color, you need to pass a valid web color or a valid hex color, e.g.: #000 for black.

JohnCoene avatar Dec 12 '24 20:12 JohnCoene