简体   繁体   English

高图-具有相同对象的多个图表

[英]Highcharts - Multiple charts with same object

With highcharts, I have to display two (or three) charts on the same page and I wonder if it possible to do it without creating two div, with only one object. 使用highcharts,我必须在同一页面上显示两个(或三个)图表,并且我想知道是否可以仅创建一个对象而无需创建两个div。

I realised a capture to explain : http://el.juky.free.fr/two_charts.jpg 我实现了捕获以进行解释: http : //el.juky.free.fr/two_charts.jpg

Created from the fiddle : jsfiddle.net/mn92t5tL/2 从小提琴创建:jsfiddle.net/mn92t5tL/2

So I wish to display the line "Line2" and its legend below the first chart "Histo1" and not on it (in fact, the two charts are linked only by the xAxis). 因此,我希望在第一个图表“ Histo1” 下方不是在其上显示“ Line2”行及其图例(实际上,这两个图表仅通过xAxis链接)。

I know it is possible to create 2 div but, because the xAxis are linked, I want to keep only one highchart object, so that the zoom is apply to all graph. 我知道可以创建2 div,但是由于xAxis是链接的,因此我只想保留一个highchart对象,以便将缩放应用于所有图形。

Thank you. 谢谢。

Yes. 是。 You can have multiple y axes, and align them vertically. 您可以有多个y轴,并将它们垂直对齐。

Example : Example

code: 码:

yAxis: [{
    height:100
},{
    top:145,
    height:80,
    offset:0
}]

You have to make sure to assign each data series to the relevant axis as well. 您还必须确保将每个数据系列也分配给相关的轴。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM