rCharts:Highcharts - 如何翻转条形图的坐标?

时间:2015-11-07 13:14:08

标签: highcharts rcharts

我期待一个正常的条形图。但是,X轴是Y轴的位置:

我认为找到righ文档非常困难,但感谢@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

我可以根据需要添加数据

1 个答案:

答案 0 :(得分:0)

我找到了解决方案:

RCharts包中没有很好的文档。因为它是一个包装器。所有需要的文档都应该在JS库的官方页面中查找,在这种情况下&#34; highcharts&#34;。

这是colum图表的页面(从我的expirience它应该被称为条形图(ggplot2用户),因此我头脑中的混乱):

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

您应该点击&#34;查看选项&#34;并复制类型部分

只需将图表类型更改为&#34;列&#34;:

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