2014-02-26 6 views
4

안녕하세요 저는 rCharts 딤플 자바 스크립트 라이브러리를 사용하여 그래프를 그렸습니다. 그러나 올바르게 표시되지 않는 x 레이블에 문제가 있습니다. setBoundssetMargins을 사용하지 않고 어떤 시도도했습니다. 어떤 도움도 환영합니다! Thx제대로 표시된 x 레이블 rCharts 및 dimplejs

# my data (I put all because with less data there's no problem : x labels appears horizontally) 
structure(list(date = c("2014-01-01", "2014-01-02", "2014-01-03", 
"2014-01-04", "2014-01-05", "2014-01-06", "2014-01-07", "2014-01-08", 
"2014-01-09", "2014-01-10", "2014-01-11", "2014-01-12", "2014-01-13", 
"2014-01-14", "2014-01-15", "2014-01-16", "2014-01-17", "2014-01-18", 
"2014-01-19", "2014-01-20", "2014-01-21", "2014-01-22", "2014-01-23", 
"2014-01-24", "2014-01-25", "2014-01-26", "2014-01-27", "2014-01-28", 
"2014-01-29", "2014-01-30"), value = c(198L, 391L, 353L, 176L, 
143L, 544L, 497L, 553L, 572L, 492L, 165L, 179L, 452L, 687L, 578L, 
561L, 529L, 182L, 191L, 494L, 515L, 592L, 576L, 598L, 203L, 199L, 
577L, 586L, 588L, 345L), date2 = c("mer. 01", "jeu. 02", "ven. 03", 
"sam. 04", "dim. 05", "lun. 06", "mar. 07", "mer. 08", "jeu. 09", 
"ven. 10", "sam. 11", "dim. 12", "lun. 13", "mar. 14", "mer. 15", 
"jeu. 16", "ven. 17", "sam. 18", "dim. 19", "lun. 20", "mar. 21", 
"mer. 22", "jeu. 23", "ven. 24", "sam. 25", "dim. 26", "lun. 27", 
"mar. 28", "mer. 29", "jeu. 30")), .Names = c("date", "value", 
"date2"), row.names = c(NA, -30L), class = "data.frame") 

# the graph 
library(rCharts) 
d1 <- dPlot(
    value ~ date2, 
    data = x, 
    type = 'line' 
) 
d1$xAxis(orderRule="date") 
d1 

답변

3

해결되었습니다!

d1 <- dPlot(
    value ~ date2, 
    data = x, 
    type = 'line', 
    # Add bounds here 
    bounds = list(x=70,y=10,height=320,width=500) 
) 
d1$xAxis(orderRule="date") 
d1