简体   繁体   中英

Highcharts plotLines with multiple xAxis and yAxis

I have a chart with multiple xAxis and yAxis . I want to have multiple plotLines on the xAxis, but each plotLine doesn't stay on it's course. Here's the fiddle . Click on All to see what I mean.

The plotLine on the first axis goes to the second axis as well. How could I stop it?

There is a solution suggested in the HighCharts issue tracker which involves defining the related xAxis on each yAxis . So a plotline defined on a particular xAxis will use the top and height of the related yAxis to draw the plotline only in the correct area.

yAxis: [{
    title: {
        text: 'OHLC'
    },
    height: 200,
    lineWidth: 2,
    xAxis: 0,
}, {
    title: {
        text: 'Volume'
    },
    top: 300,
    height: 100,
    offset: 0,
    lineWidth: 2,
    xAxis: 1,
}, {
    title: {
        text: 'Other data panel'
    },
    top: 300,
    height: 100,
    offset: 0,
    lineWidth: 2,
    opposite: true,
    xAxis: 1,
}]

Updated Fiddle with each plotline only on its corresponding pane.

Note that the ability to define related axes appears to be undocumented in the API .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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