nvd3中是否有缩放功能,能否直接在我的R源代码中输入(只要不需要更改nvd3源代码就可以使用javascript)?我尝试了lineWithFocusChart,但那只能沿着x轴缩放,我想最好是绘制一个框,将缩放部分的内容缩放到我所绘制的位置。即使不可能实现这一点,如果nvd3支持任何类型的2D缩放,那也很棒!我提供了一个可重现的示例,但我还没有找到我正在寻找的缩放功能。谢谢!
library(rCharts)
temp <- data.frame(x = 1:100, y = 1:100, z = c(rep(1,50), rep(0,50)))
g <- nPlot(y ~ x, group = "z", data = temp, type = "lineChart")
g$templates$script <- "http://timelyportfolio.github.io/rCharts_nvd3_templates/chartWithTitle_styled.html"
g$set(title = "Example")
g$chart(transitionDuration = -1,
tooltipContent = "#! function(key, x, y) {
return 'z: ' + key + '<br/>' + 'x: ' + x + '<br/>' + 'y: ' + y
}!#",
showLegend = FALSE, margin = list(left = 200,
right = 100,
bottom = 100,
top = 100))
g$xAxis(axisLabel = "x")
g$yAxis(axisLabel = "y", width = 40)
g