nPlot 日期显示为计算的整数
nPlot dates are appearing as a calculated integer
output$plot3 <- renderChart2({
dat <- candyData[candyData$candyChoice %in% input$candyChoice, ]
if(!is.na(dat)){
n <- nPlot(freq ~ purchase_month, group = 'candy choice', data=dat, type = "lineChart")
}
})
我的日期在我的控制台中打印时显示如下:
"2014-04-01" "2014-05-01" "2014-06-01" "2014-07-01" "2014-08-01" "2014-09-01" "2014-10-01"
"2014-11-01" "2014-12-01" "2015-01-01" "2015-02-01" "2015-03-01" "2015-04-01" "2015-05-01"
"2015-06-01" "2015-07-01" "2015-08-01"
我在地块上的日期显示如下:
我们热烈欢迎任何有关如何解决此问题的建议!
更新 2
图形线条与 nPlot 交互式工具提示不匹配。你知道如何解决这个问题吗?
格式化你的 xaxis
n$xAxis(tickFormat ="#! function(d) {return d3.time.format('%Y/%m')(new Date(d*1000*3600*24));} !#")
output$plot3 <- renderChart2({
dat <- candyData[candyData$candyChoice %in% input$candyChoice, ]
if(!is.na(dat)){
n <- nPlot(freq ~ purchase_month, group = 'candy choice', data=dat, type = "lineChart")
}
})
我的日期在我的控制台中打印时显示如下:
"2014-04-01" "2014-05-01" "2014-06-01" "2014-07-01" "2014-08-01" "2014-09-01" "2014-10-01"
"2014-11-01" "2014-12-01" "2015-01-01" "2015-02-01" "2015-03-01" "2015-04-01" "2015-05-01"
"2015-06-01" "2015-07-01" "2015-08-01"
我在地块上的日期显示如下:
我们热烈欢迎任何有关如何解决此问题的建议!
更新 2
图形线条与 nPlot 交互式工具提示不匹配。你知道如何解决这个问题吗?
格式化你的 xaxis
n$xAxis(tickFormat ="#! function(d) {return d3.time.format('%Y/%m')(new Date(d*1000*3600*24));} !#")