2015-11-07 60 views
0

我在等待一个正常的条形图。然而,X轴是在Y轴应该是:rCharts:Highcharts - 如何翻转条形图的坐标?

我觉得它是如此难以找到右击文档,但由于@ramnathv这些包装

enter image description here

RCODE:

h1 <- hPlot(x = "fuente", y = "sessions", data = usertypexfuente2, type = c("bar")) 

h1$tooltip(formatter="#!function() { 
    return 'Sesiones ' + 
    ': <b>' + this.y + '</b>' + ' (' + this.x + ')' ; 
}!#") 


h1 

我可以添加数据,如果需要的话

回答

0

我找到了一个解决方案:

RCharts包没有很好的文档。由于它是一个包装。所有需要的文档都应该在JS库的官方页面中查找,在这种情况下是“highcharts”。

这是科拉姆图表的页面(从我的expirience它应该被称为柱状图(GGPLOT2用户),因此在我脑海中的混乱):

http://www.highcharts.com/demo/column-basic

您应该点击“查看选项”,并复制型部分

只需将图的类型更改为‘列’:

RCODE:

h1 <- hPlot(x = "fuente", y = "sessions", data = usertypexfuente2, type = c("column")) 

h1$tooltip(formatter="#!function() { 
    return 'Sesiones ' + 
    ': <b>' + this.y + '</b>' + ' (' + this.x + ')' ; 
}!#") 


h1