JohnCoene / echarts4r

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

Histogram plot isn't working anymore #559

Closed AdrianAntico closed 9 months ago

AdrianAntico commented 1 year ago

For some reason the histogram is no longer generating an output plot. Below is code from the examples on the home page...

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

df |> 
  e_charts() |> 
  e_histogram(y) |> 
  e_tooltip()
munoztd0 commented 1 year ago

Yeah you have to add name = "histogram" now

library(echarts4r)

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

plot = df |> 
  e_charts() |> 
  e_histogram(y, name = "histogram") |> 
  e_tooltip()

plot

image

I am going to change the doc or make it by default so it work with the legacy code.

thanks for noticing us !

AdrianAntico commented 1 year ago

@munoztd0 thanks for the quick response. This is a great package that I utilize often

munoztd0 commented 1 year ago

@AdrianAntico thanks for the appreciation, here is my buy me a coffee link if you feel like it

AdrianAntico commented 1 year ago

@munoztd0 I ran into something similar with the bar plot using the polar option. Is there a similar update to that plot call as well?

df <- data.frame(x = 1:10, y = seq(1, 20, by = 2))

df |>
  e_charts(x) |>
  e_polar() |>
  e_angle_axis() |>
  e_radius_axis() |>
  e_line(y, coord.system = "polar", smooth = TRUE)
munoztd0 commented 9 months ago
library(echarts4r)

df <- data.frame(x = 1:10, y = seq(1, 20, by = 2))

plot <- df |>
  e_charts(x) |>
  e_polar() |>
  e_angle_axis() |>
  e_radius_axis() |>
  e_line(y, coord_system = "polar", smooth = TRUE)

plot

image

Created on 2023-12-21 with reprex v2.0.2.9000

So it's just that coord.system is deprecated by coord_system apparently, I'm gonna change it now, thanks for noticing.

munoztd0 commented 9 months ago

fixed in #606