javascript - 如何从 highchart.js 中的饼图中删除空格?

标签 javascript jquery highcharts

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

我想删除上面用红色圈出的空白。我在 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/

最佳答案

在绘图选项中使用 borderWidth :0

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

         borderWidth: 0, // This removes the border

更新 fiddle :http://jsfiddle.net/jF22s/5/

如果这是 Not Acceptable (因为它仍然有非常小的空间),请向图表添加相同颜色的边框,这将删除所有空间:

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

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

关于javascript - 如何从 highchart.js 中的饼图中删除空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21901455/

相关文章:

javascript - ReactJs 保护路由重定向/刷新问题

javascript - 在 Impress.js 轮播中面临问题

jquery - 有效地沿着上下 sibling 遍历

javascript - jquery中如何显示<p>的内容

Highcharts.js-同一页面上有多个主题?

highcharts - 如何使用 highcharts 在工具提示中隐藏一个系列数据信息

javascript - Cognito 从预注册 Lambda 触发器发送什么样的事件

javascript - JQuery:切换问题

javascript - 在幻灯片上插入覆盖的 Div

ruby-on-rails - Ruby on Rails、JSON 和 Highcharts