Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to configure toolbox features using custom theme #654

Open
gacolitti opened this issue Feb 24, 2025 · 0 comments
Open

Unable to configure toolbox features using custom theme #654

gacolitti opened this issue Feb 24, 2025 · 0 comments

Comments

@gacolitti
Copy link

Assuming I have a custom theme file custom-theme.json with the following:

{
    "toolbox": {
        "feature": {
            "dataZoom": {
                "yAxisIndex": "none"
            },
            "restore": {}
        }

    }
}

and then run:

library(echarts4r)

d <- data.frame(
  x = 1:10,
  y = 1:10
)

d |> 
  e_chart(x = x) |> 
  e_line(y) |> 
  e_theme_custom("custom-theme.json")

I get the following plot without datazoom:

Image

But this works as expected:

library(echarts4r)

opts <- list(
  xAxis = list(
    type = "value",
    data = d$x
  ),
  yAxis = list(
    type = "value"
  ),
  series = list(
    list(
      type = "line",
      data = d$y
    )
  ),
  toolbox = list(
    feature = list(
      dataZoom = list(
        yAxisIndex = "none"
      ),
      restore = list(
      )
    )
  )
)

e_charts() |>
  e_list(opts)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant