我有一个leonawicz 的参考,可以完美地结合迷你线和DT(非常感谢他).但是,你能帮我一个合成的迷你线吗?非常感谢!.
这是示例代码
library(data.table)
library(DT)
library(sparkline)
Data <- data.table(Type = c("A", "B", "C"),
Value_1 = c("1,1,2,2", "2,2,3,3", "3,3,4,4"),
Value_2 = c("0,1,2,3", "2,3,4,5", "4,5,6,7"))
r <- c(0, 8)
line_string <- "type: 'line', lineColor: 'black', fillColor: '#ccc',
highlightLineColor: 'orange', highlightSpotColor: 'orange',
width: 80,height: 60"
cb_line = JS(paste0("function (oSettings, json) {
$('.spark:not(:has(canvas))').sparkline('html', { ",
line_string, ", chartRangeMin: ", r[1], ", chartRangeMax: ",
r[2], " }); }"), collapse = "")
cd <- list(list(targets = 1:2, render = JS("function(data, type, full){ …
Run Code Online (Sandbox Code Playgroud)