How to remove space from pie chart in highchart.js?

Blue circle with whitespace at the top, circled in red.

I want to remove the white space circled in red above. I use the code below in jsFiddle:

$(function () {

$('#container').highcharts({
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false,borderRadius: 0,
                    borderWidth:0,
    },
    title: {
        text: 'Browser market shares at a specific website, 2010'
    },
     tooltip: false,
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: true,
                color: '#000000',
                connectorColor: '#000000',
                format: '<b>{point.name}</b>: {point.percentage:.1f} %'
            }
        }
    },
    series: [{
        type: 'pie',
        name: 'Browser share',
         size: '115%',
         innerSize: '110%',
        data: [
            ['Firefox',   45.0]

        ]
    },{type: 'pie',
        name: 'Browser share',
         size: '100%',
                        innerSize: '98%',
        data: [
            ['Firefox',   45.0]

        ]}
]});
});

Fiddle: http://jsfiddle.net/jF22s/

+4
source share
3 answers

Unfortunately, this is a known bug, reported here.

+2
source

use borderWidth :0in the plot settings.

  pie: {
        allowPointSelect: true,
        cursor: 'pointer',

         borderWidth: 0, // This removes the border

Updated script: http://jsfiddle.net/jF22s/5/

If this is unacceptable (since it still has a very minute space), add a border of the same color to the chart, which will remove all the space:

borderWidth: 1,
borderColor:'#2F7ED8',

: http://jsfiddle.net/jF22s/15/

+5

borderColor: null

plotOptions: {
    pie: {
        borderColor: null,
    }
}

ref: http://jsfiddle.net/highcharts/NK5db/17/

+1
source

Source: https://habr.com/ru/post/1527840/


All Articles