-
Notifications
You must be signed in to change notification settings - Fork 636
Open
Description
I attempt to use the hovertemplate argument to format the hover text, but it cannot properly display.
However the argument works for type = "scatter". Similar issue was found in #1636 with box plot.
df <- tibble(x = sample(letters[1:3], 100, replace = T), y = rnorm(100))
df %>% plot_ly(
x = ~x,
y = ~y,
split = ~x,
type = 'violin',
box = list(
visible = TRUE
),
hovertemplate = "%{y}", # not work
hoveron = "kde",
jitter = 1,
alpha = 0.5,
spanmode = "hard"
)
)Using text argument + hoverinfo will let the hover disappear completely
df %>% plot_ly(
x = ~x,
y = ~y,
split = ~x,
text = ~y, # using text argument
type = 'violin',
box = list(
visible = TRUE
),
hoverinfo = "text", # with hoverinfo
hoveron = "kde",
jitter = 1,
alpha = 0.5,
spanmode = "hard"
)
)Using hoverinfo = "y" comes along with kde
df %>% plot_ly(
x = ~x,
y = ~y,
split = ~x,
type = 'violin',
box = list(
visible = TRUE
),
hoverinfo = "y",
hoveron = "kde",
jitter = 1,
alpha = 0.5,
spanmode = "hard"
)However, hoverinfo = "x" works properly,
df %>% plot_ly(
x = ~x,
y = ~y,
split = ~x,
type = 'violin',
box = list(
visible = TRUE
),
hoverinfo = "x",
hoveron = "kde",
jitter = 1,
alpha = 0.5,
spanmode = "hard"
)R version = 4.0.5, R-plotly version = 4.9.3
Metadata
Metadata
Assignees
Labels
No labels



