Using rCharts wrapper for High Charts, how would I plot different charts onto the same graph? In other words, I would essentially want one chart, let's call it h1, to be its own chart with its own x-axis and y-axis and another chart h2 to have its own x-axis and y-axis, but I would like to be able to return some final chart, say h3, that stacks h1 and h2 into one object that I can return with my plotting function. Is this possible? I don't have an example because I don't have an understanding of how to really approach this problem right now. Thank you.
Asked
Active
Viewed 739 times
0
-
Can you provide your ui.R and server.R to get better idea of what you are trying to do ? You can find a possible answer here http://stackoverflow.com/questions/21895321/shiny-rcharts-multiple-chart-output – Shiva Jul 07 '15 at 12:59
-
Hi Shiva, Thanks for looking into it. I have the exact same format as the answer in that link, but I wanted my output to only have one stacked graph rather than requiring two outputs rendering one graph each. I'm planning to use these for animation, and when I use two separate graphs, it slows down my application, so I believe one stacked graph has the potential to be quicker. – johnny838 Jul 07 '15 at 21:08
-
Looks like you got answer! Good luck with that! – Shiva Jul 07 '15 at 21:13
1 Answers
1
I don't know anything about the rCharts side of it.
But to do this in Highcharts, you can specify multiple y axes, specifying a top
an height
property, and multiple x axes, using the offset
property.
Then you assign an xAxis
and a yAxis
for each data set.
xAxis: [{
offset : -120
},{
}],
yAxis: [{
title : { text: 'Y Axis 0' },
height : 100
},{
title : { text: 'Y Axis 1' },
offset : 0,
top : 200,
height : 100
}]
Example:

jlbriggs
- 17,612
- 4
- 35
- 56
-
Thank you, this is exactly what I'm looking for! I should be able to translate this into R. Thanks for the idea! – johnny838 Jul 07 '15 at 21:10