user1471980
user1471980

Reputation: 10656

how do you draw two yAxis chart in highcharts

I need to build a highchart with 2 yAxis, one on the left (primary) and one on the right(secondar). I was not able to make this work. Any ideas what I am doing wrong here or missing?

here is the jsfiddle: http://jsfiddle.net/gsaray101/KX4AS/2/

I am using the example from the highcharts site as this:

yAxis: [{ // Primary yAxis
                labels: {
                    format: '{value}ms',
                    style: {
                        color: '#89A54E'
                    }
                },
                title: {
                    text: 'response time',
                    style: {
                        color: '#89A54E'
                    }
                }
            }, { // Secondary yAxis
                title: {
                    text: 'volume',
                    style: {
                        color: '#4572A7'
                    }
                },
                labels: {
                    format: '{value}',
                    style: {
                        color: '#4572A7'
                    }
                },
                opposite: true
            }],

Upvotes: 0

Views: 216

Answers (1)

Barbara Laird
Barbara Laird

Reputation: 12717

Axis are 0 based. So you need (http://jsfiddle.net/zEBSh/)

var data = [{ "name": "1", "yAxis": 0, "data": [ [1374019440000, 25],

        [1374056640000, 43],
        [1374056880000, 49]
    ]
}, {
    "name": "2",
    "yAxis":1,
    "data": [
        [1374019440000, 33],
        [1374019740000, 42],

Upvotes: 1

Related Questions