AGamePlayer
AGamePlayer

Reputation: 7734

How to reduce the margin above a polar chart with HighCharts?

In this case with the image showed. The margin is too large. Is there anyway to make it smaller or even zero?

http://jsfiddle.net/7rLnwdxu/1/

the margin is too large

Code:

$(function () {

$('#container').highcharts({

    chart: {
        polar: true,
        type: 'line'
    },

    title: {
        text: 'Budget vs spending',
        x: -80
    },

    pane: {
        size: '80%'
    },

    xAxis: {
        categories: ['Word1_Word2', 'Word1 Word2', 
        'Word1 - Word2', 'Word1-Word2', 
        'Word1 Word2', 'Word1 Word2'],
        tickmarkPlacement: 'on',
        lineWidth: 0
    },

    yAxis: {
        gridLineInterpolation: 'polygon',
        lineWidth: 0,
        min: 0
    },

    tooltip: {
        shared: true,
        pointFormat: '<span style="color:{series.color}">{series.name}: <b>${point.y:,.0f}</b><br/>'
    },

    legend: {
        align: 'right',
        verticalAlign: 'top',
        y: 70,
        layout: 'vertical'
    },

    series: [{
        name: 'Allocated Budget',
        data: [43000, 19000, 60000, 35000, 17000, 10000],
        pointPlacement: 'on'
    }, {
        name: 'Actual Spending',
        data: [50000, 39000, 42000, 31000, 26000, 14000],
        pointPlacement: 'on'
    }]

});
});

Upvotes: 0

Views: 99

Answers (1)

Asad Sarwar
Asad Sarwar

Reputation: 583

You can do this with 'marginTop' property in chart options like:

chart: {
    marginTop: 10,
    polar: true,
    type: 'line'
}

This value is in pixels.

Upvotes: 1

Related Questions