I'm using a csv file from excel to import data and then I use it in rCharts. The dates are imported as 39873, 39904, etc and to convert them I use
tickFormat = "#!function(d){return d3.time.format('%b %Y')(new Date(d*60*60*24*1000))}!#"
The problem is the command shows jan-2076, feb-2076, etc instead of jan-2006, feb-2006, etc
Any ideas on how to substract 70 years to the dates?
Best regards MV
EDIT: full code:
p2 <- nPlot(tasa ~ periodo2, group = 'indicador', data = data, type = 'lineChart', id = 'chart')
p2$xAxis(axisLabel = 'fecha', rotateLabels = -30,
tickFormat = "#!function(d){return d3.time.format('%b %Y')(new Date(d*60*60*24*1000))}!#")
p2$yAxis(axisLabel = '%')
p2$chart(tooltipContent = "#! function(key, x, y){
return key + '<p>' + y + '%' + ' en ' + x + '</p>'} !#",
margin = list(left = 80, bottom = 80),
color = c('#ff3232','#4332ff'))
#p2$set(width = 800, height = 500)
p2