There are some scenarios where the lower and upper y-limits need to be set manually, which may go into the negative values. Here is an example:
dat <- data.frame(
month = seq(as.Date('2024-01-01'), length.out = 24, by = "month"),
den = rpois(24, lambda = 5)
)
dat$num <- sapply(dat$den, function(x) rbinom(1, x, 0.25))
controlcharts::spc(
data = dat,
numerators = num,
denominators = den,
labels = num,
keys = month,
spc_settings = list(chart_type = "p"),
y_axis_settings = list(
ylimit_l = -20,
ylimit_u = 100
),
label_settings = list(
label_position = "bottom",
label_line_max_length = 30
)
)
Which generates the following chart:

It would be useful to be able to toggle off any negative tick labels, so these don't show up on the y-axis.