Russ Back
Russ Back

Reputation: 923

Remove padding above bar columns

We have a bar chart where the columns do not reach the top of the graph container. How can we remove that?

{
data: {
    chart: {
        type: 'column',
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false,
        margin: [0, 0, 0, 0],
        backgroundColor:'rgba(255,255,255,0.002)'
    },
    colors: TallPoppies.templateColours, 
    legend: {
        enabled: false
    },
    title: null,
    plotOptions: {
        series: { 
            animation: false
        }, 
        column: {
            cursor: 'pointer',
            dataLabels: {
                enabled: false
            },
            groupPadding: 0,
            pointPadding: 0.1,
            borderColor: 'pink'
        }
    },
    series: [{
        type: 'column',
        name: 'Skill',
        data: [
            { name:'blah 1', 
              color: 'red',
              y: 2
            },
            { name:'blah 2', 
              color: 'yellow',
              y: 4
            },
        ]
    }],
    xAxis: {
       lineWidth: 0,
       minorGridLineWidth: 0,
       lineColor: 'transparent',
       labels: {
           enabled: false
       },
       minorTickLength: 0,
       tickLength: 0
    },
    yAxis:{ 
      gridLineWidth: 0,
      minorGridLineWidth: 0
    }
}

}

Upvotes: 0

Views: 266

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Set:

See:

yAxis:{ 
  endOnTick: false,
  maxPadding: 0,
  gridLineWidth: 0,
  minorGridLineWidth: 0
}

Upvotes: 3

Related Questions