johnny838
johnny838

Reputation: 932

How Do I put Multiple Charts on the Same Graph rCharts High Charts

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.

Upvotes: 0

Views: 773

Answers (1)

jlbriggs
jlbriggs

Reputation: 17791

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:

Upvotes: 1

Related Questions