Open royfrancis opened 5 years ago
Yes, I think it is the same issue as #98, and it is currently beyond my expertise.
A workaround who works well with ggplotly
, ggiraph
and now highcharter
(just tested) :
I spotted it in this really nice talk wombat::gganimate
Try this :
---
title: "Highcharter test"
output:
xaringan::moon_reader
---
```{r, echo = FALSE, warning = FALSE, message = FALSE}
library(highcharter)
h <- iris %>%
hchart("scatter",hcaes(x="Sepal.Length",y="Sepal.Width",group="Species")) %>%
hc_xAxis(title=list(text="Sepal Length"),crosshair=TRUE) %>%
hc_yAxis(title=list(text="Sepal Width"),crosshair=TRUE) %>%
hc_chart(zoomType="xy",inverted=FALSE) %>%
hc_legend(verticalAlign="top",align="right") %>% hc_size(height=350)
htmlwidgets::saveWidget(h, "highchrt_ex.html")
<iframe src="highchrt_ex.html" width = "900px", height = "600px" frameBorder="0">
When using the highcharter interactive graphics in xaringan, the hover tooltip seems to be offset from the cursor position. See demonstration below.
If I knit the RMarkdown file in RStudio using the Knit button, the rendered preview in the RStudio browser seems to work fine. When I render the RMarkdown to HTML using
rmarkdown::render()
, the tooltips are offset. Issue is seen in both browsers tested: Firefox and Chrome. The tooltips also work fine when rendered to regular RMarkdown (html_document()
).The RMarkdown document I use is here:
Perhaps this is related to #98