0

我想在 YAxes 中为图形“百分比”留出填充。我需要在酒吧后面留一个空格。看下面的代码。

'chart = new Highcharts.Chart({ chart: { renderTo: 'container', 倒置: 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
    }]
});'

谢谢!

4

1 回答 1

1

您可以为图表添加右边距,这将为标签 http://api.highcharts.com/highcharts#chart.marginRight提供空间

此外 - 带有“inverted:true”的柱形图与条形图相同。为什么不直接使用“bar”类型?

于 2013-03-28T16:10:30.223 回答