سؤال

I've got a working combination chart. Line + columns.

The line is at the bottom of the chart because the numbers are low (between 5 - 10%). The columns' numbers are around 80% so they're up to the top of the chart. This is normal behavior.

I know in Excel you can shift or offset this line to the top of the chart so that it sits on top of the columns... Is this possible with Highcharts? How do you do this offset in Highcharts? I looked everywhere in the docs but can't find a solution...

enter image description here

thanks in advance,

Bart

هل كانت مفيدة؟

المحلول

You can use second yAxis, so you will be able to set extremes, which will work as your offset, see: http://jsfiddle.net/3bQne/921/

var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container'
    },
    xAxis: {
        categories: ['01/02/2012', '01/03/2012', '01/04/2012', '01/05/2012', '01/06/2012', '01/07/2012']
    },
    yAxis: [{
        // default options
    }, {
        opposite: true,
        min: 0,
        max: 5
    }],
    series: [{
        type: 'column',
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0]
    }, {
        type: 'line',
        data: [4, 4, 4, 4, 4, 4],
        yAxis: 1
    }]
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top