JohnCoene / echarts4r

🐳 ECharts 5 for R
http://echarts4r.john-coene.com/
Other
585 stars 82 forks source link

[Bug] on example code of Histogram #617

Closed jhk0530 closed 4 months ago

jhk0530 commented 4 months ago

Hi John, thanks for nice work.

in webpage (pkgdown) there is example code and result for histogram

https://echarts4r.john-coene.com/articles/stats#histogram

# data.frame
df <- data.frame(
  x = 1:100,
  y = rnorm(100, 20, 12)
)

df |> 
  e_charts() |> 
  e_histogram(y) |>  # NOT WORK
  e_tooltip()

However, when I tried this code it didn't make chart. Instead when I changed code as e_histogram(y, name = 'histogram') |> it worked. This working code is from manual page of e_histogram function, so I think update code may good for beginner like me.

Below is Example code from help page of e_histogram. Also below code doesn't work when name = NULL

mtcars |>
  e_charts() |>
  e_histogram(mpg, name = "histogram") |>
  e_tooltip(trigger = "axis")

If you allow, I'd like to make PR for this.

Thanks.

jhk0530 commented 4 months ago

I found this is same with issue #559.