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

added support for grouped bars in e_error_bar #224

Merged
merged 2 commits into from
Nov 3, 2020
Merged

added support for grouped bars in e_error_bar #224

merged 2 commits into from
Nov 3, 2020

Conversation

helgasoft
Copy link
Contributor

@helgasoft helgasoft commented Nov 2, 2020

fixing #120 and #103 - thanks to @matthias-a for the right direction and @JohnCoene for readiness to help

helgasoft and others added 2 commits October 30, 2020 16:57
added support in e_error_bar for grouped bars.
@helgasoft
Copy link
Contributor Author

Found a bug. When data is without categories, legend click does not hide error bars along with the main bars.
To reproduce:

  df <- data.frame(
    x = factor(c(1, 2)),
    y = c(1, 5),
    upper = c(1.1, 5.3),
    lower = c(0.8, 4.3)
  )
  df %>%
    e_charts(x) %>%
    e_bar(y) %>%
    e_error_bar(Lower, Upper)

This is due to a missing error bar name, and here is the fix

#  in e_error_bar_  (add_.R) replace:
      if (!is.null(name)) {
        nm <- name
      } else {
        nm <- .name_it(e, NULL, name, i)
        # nm <- paste(nm, "error")	    # comm.out: now adopts main bar's name
        nm <- trimws(nm)
      }
# with:
      nm <- .name_it(e, e$x$opts$series[[i]]$name, name, i)

@JohnCoene JohnCoene merged commit 74e76f8 into JohnCoene:master Nov 3, 2020
@JohnCoene
Copy link
Owner

Thank you for this!

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

Successfully merging this pull request may close these issues.

None yet

2 participants