0
votes

I want to put padding left for graphic "percent" in YAxes. I need one space after the bars. Look the code below.

'chart = new Highcharts.Chart({ chart: { renderTo: 'container', inverted: true, type: 'column' },

    title: {
        text: 'Indicatores por Sexo'
    },

    xAxis: {
       categories: [
            'Jan',
            'Fev',
            'Mar',
            'Apr',
            'May',
           'Jun',
           'Jul',
           'Aug',
           'Sep',
           'Oct',
           'Nov',
           'Dez'
       ],
       title: {
           text: 'Meses'
       },
    },

    yAxis: {
        endOnTick: false,
        maxPadding: 5,
        allowDecimals: false,
        min: 0,
        title: {
            text: 'Quantidade de Consultas'
        },
        stackLabels: {
            style: {
                color: 'black'
            },

            enabled: true,
            formatter: function() {
                return "Product A";
            }
        }
    },

    tooltip: {
        formatter: function() {
            return '<b>'+ this.x +'</b><br/>'+
                this.series.name +': '+ this.y +'<br/>'+
                'Total: '+ this.point.stackTotal;
        }
    },

    plotOptions: {
        column: {
            stacking: 'percent'
        },
        series : {
            pointWidth: 10,
            minPointLength: 3,
        }
    },

    series: [{
        data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], //inclusoesExclusoesChequeFeminino[0]
        color: '#FF0000',
        stack: 0
    }, {
        data: [12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], //inclusoesExclusoesChequeMasculino[0]
        color: '#3333FF',
        stack: 0
    }, {
        data: [10, 20, 30, 40, 50, 60, 60, 50, 40, 30, 29, 10], //inclusoesExclusoesSPCFeminino[0]
        color: '#FF0000',
        stack: 1
    }]
});'

Thank you!

1

1 Answers

1
votes

You can add a right margin to the chart, which will provide space for the label http://api.highcharts.com/highcharts#chart.marginRight

Also - a column chart with 'inverted:true' is identical to a bar chart. Why not just use type 'bar'?