Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts - multiple plot with the same x scale

I want to make a multiple plots with the x-axis aligned so that we can compare two set of data. I want it to look like this

https://stackoverflow.com/a/11796553/229075

In my case there are some addition requirement that some of the plot are lines and some are bar. So the default scale does not align even if the data range are the same.

I found some good suggestion about "stacking" the charts. It is a little bit complicated but a promising way to try.

https://stackoverflow.com/a/12179023/229075

However I also have other use case that may push the envelop of simple stacking. For example, I'd like to do scatter plot matrix sometime when both x-axis and y-axis have to align like this

http://www.statmethods.net/graphs/images/spmatrix3.png

Rather than putting many chart in one Highchart, this may requires have many separate charts but have better control in how the axis is layout.

like image 819
Wai Yip Tung Avatar asked Nov 12 '22 12:11

Wai Yip Tung


1 Answers

If you want to use one one chart, you can use linkedTo option to connect axis.

If you want more simple charts, you can manage to connect axis using event afterSetExtremes, where you can call setExtremes() for another chart.

like image 75
Paweł Fus Avatar answered Dec 15 '22 18:12

Paweł Fus