Code
library(highcharter)
library(tidyverse)
<- hchart(citytemp_long, "line", hcaes(month, temp, group = city)) %>%
hc hc_add_theme(hc_theme_538())
hc
January 7, 2021
Time ago we make some really nice but complex tooltips showing charts from the selected points using {highcharter}
package (and highcharts) in the using tooltips in unexpected ways post. But sometimes we need less: a tiny toolip, maybe for have few available space, or maybe requirements.
So in this post we’ll detail the parameters in highcharter::hc_tooltip
function used in the valuebox and sparklines post to get what we want.
First, let’s try a normal chart with a traditional tooltip.
Did you see the tooltip? Is just a normal one, nothing special, it works :). Now, what we came for, but before change arguments let’s make clear what we’ll change:
pointFormat
argument removing the “:” in the text because the textOutline
effect don’t work very well with this character.borderWidth
to 0.And voila.
@online{kunst fuentes2021,
author = {Kunst Fuentes, Joshua},
title = {Minimalistic Toolptips with Highcharter/Highcharts},
date = {2021-01-07},
url = {https://jkunst.com/blog/posts/2021-01-07-minimalistic-toolptips-with-highcharter-and-highcharts},
langid = {en}
}