ramnathv / rCharts

Interactive JS Charts from R
http://rcharts.io
Other
1.19k stars 654 forks source link

Creating multi-line x-tick labels with nPlot #399

Open kaneplusplus opened 10 years ago

kaneplusplus commented 10 years ago

Is there an easy way to make the x-tick labels multiline? Adding the '\n' character doesn't seem to work.

require(rCharts)
d <- data.frame(list(x="label1\nline2", y=4))
nPlot(y="y", x="x", data=d, type='discreteBarChart')
ramnathv commented 10 years ago

It is possible to do this using some d3 wizardry after the chart has been created. I will try to figure out how it can be easily inserted in the nvd3 plot created straight from rCharts instead of having to modify the HTML file afterwards.

JonathanMcGuire commented 8 years ago

Hi Ramanth, Have you had a chance to look at this issue yet? I found this example of axis label wrapping for nvd3, but I'm not familiar enough with d3 to implement this. Cheers Jonathan