adjusting axis labels NVD3 graph in rCharts

安稳与你 提交于 2019-12-03 13:49:10

The answer to your question can be found here. The basic idea is to set the option reduceXTicks to FALSE and also stagger the labels.

n1 <- nPlot(value ~ region, data = dat, group = 'variable', 
  type = 'multiBarChart')
n1$chart(reduceXTicks = FALSE)
n1$xAxis(staggerLabels = TRUE)

If the labels are big, you can control the size of the text using CSS. For now, you would have to manually insert this into your HTML, but in future version of rCharts, I will make it easy to add arbitrary HTML/CSS/JS to your chart, straight from the R console.

<style>
svg text {font-size: 9px;}
</style>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!