This function creates a customizable tooltip for SveltePlots charts. Tooltips provide additional information when hovering over data points.
sp_tooltip(
sp,
type = NULL,
format = NULL,
background_color = "white",
opacity = 0.8,
text_color = "black",
border_color = NULL,
border_width = 1,
font_size = 12,
font_family = "Arial, sans-serif",
padding = 5,
position = NULL,
show_delay = 0,
animation = FALSE,
animation_params = NULL,
justify_content = "space-between",
cross_hair = FALSE
)
A SveltePlots object with an attached tooltip.
The SveltePlots object to attach the tooltip to.
The type of tooltip, "shared" or "single". Default depends on the x-axis and is shared for date and factors and single for numeric.
The format of tooltip content.
Background color of the tooltip (default: "white").
Numeric value between 0 and 1 specifying the opacity of the tooltip (default: 0.8).
Text color of the tooltip (default: "black").
Border color of the tooltip (default: "#cccccc").
Border width of the tooltip (default: 1).
Font size of the tooltip text (default: 12).
Font family of the tooltip text (default: "Arial, sans-serif").
Padding around the tooltip content (default: 5).
Position of the tooltip relative to the data point ("top", "bottom", "left", "right").
Delay in milliseconds before showing the tooltip (default: 0).
Whether to animate the tooltip (default: FALSE).
A list containing animation parameters for multiple series when type = "shared":
The duration of the animation in milliseconds. Default is 0.
The delay before the animation starts in milliseconds. Default is 0.
How to justify the content inside the tooltip (default: "space-between").
Whether to enable crosshair (default: FALSE).