我的报告中有大约sparklines
个嵌入到html表格中.我现在一直在try 使用Quarto仪表板来编写我的报告.但是,迷你图工具提示文本的宽度会放大到整个页面的宽度.
我用reactable
文档中的代码做了一个可复制的例子:
https://glin.github.io/reactable/articles/examples.html
下面是一个快照,然后是代码.
reactable
允许我为列指定一种css样式.有没有什么css可以解决这个问题?或者在sparkline()
的基础上增加任何规格?
---
title: tooltip test
format: dashboard
editor: source
---
```{r}
#| warning: false
#| message: false
library(reactable)
library(sparkline)
library(dplyr)
library(tippy)
```
```{r}
data <- chickwts %>%
group_by(feed) %>%
summarise(weight = list(weight)) %>%
mutate(boxplot = NA, sparkline = NA)
reactable(
data,
columns = list(
weight = colDef(
header = tippy("weight", "test tooltip"),
cell = function(values) {
sparkline(values, type = "bar", chartRangeMin = 0, chartRangeMax = max(chickwts$weight))
}
),
boxplot = colDef(
header = tippy("box", "test tooltip"),
cell = function(value, index) {
sparkline(data$weight[[index]], type = "box")
}
),
sparkline = colDef(
header = tippy("line", "test tooltip"),
cell = function(value, index) {
sparkline(data$weight[[index]])
}
)
)
)
```