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
Disproportional bar length in gt_plt_bullet()
#87
Comments
I think, a potential fix either needs a switch in Line 45 in 95f7bf7
for the minimum to be either 0 or the minimum value (if negative) of the range. Alternatively, users could also specify a custom range in the function that is then applied to line Line 89 in 95f7bf7
and could then take the default as suggested above. |
so a new function parameter could be |
Made an accommodation to the range to force a zero range if not negative. Will push latest dev version shortly. library(tibble)
library(gt)
library(gtExtras)
df <- tibble(A = c(.71, .78), B = c(1.01, 1.01)) %>%
mutate(value = A, target = B, .before = A)
#resulting plot does not show bars proportionally
df %>%
gt() %>%
gt_plt_bullet(column = A, target = B) |>
gtExtras::gt_reprex_image() Created on 2023-04-11 by the reprex package (v2.0.1) library(tibble)
library(gt)
library(gtExtras)
df <- tibble(A = c(1:2, -3, 4:5), B = c(1:2, -3, 4:5), C = c(3,4,5,6,7))
df %>%
gt() %>%
gt_plt_bullet(column = B, target = C) %>%
gtExtras::gt_reprex_image() Created on 2023-04-11 by the reprex package (v2.0.1) |
In the latest dev version, I still found an issue where
gt_plt_bullet()
does not show the correct bar length or target value. I adapted the example shown in #79.Created on 2023-04-06 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: