ABSTRACT

There are two main approaches to controlling the tooltip: hoverinfo and hovertemplate. The hoverinfo attribute controls what other plot attributes are shown into the tooltip text. hovertemplate does offer a convenient approach for flexible control over tooltip text, so it can be useful as well. When constructing the text to display, ggplotly() runs format() on the computed values. Since some parameters of the format() function can be controlled through global options(), the readers can use these options() to control the displayed text. It does this through special markup rules for inserting and formatting data values inside a string. Computed values that don’t have a corresponding axis likely have a hoverformat trace attribute.