Removing the white line between slices in Flot pie

2020-04-08 12:40发布

How can I remove the white line between slices and background in Flot pie chart?

My jsfiddle

As you can see it looks like that:

White line

I want it to look like that(Ignore my bad artistic skills):

enter image description here

My Code:

$(function () {
     var data = [
    { label: "Read", data: 50, color: '#614E43' },
    { label: "Unread", data: 150, color: '#F5912D' }];
      $.plot($("#star"), data, 
      {
        series: {

          pie: { 

              radius: 0.2,  
            innerRadius: 0.125,
            show: true
          }
        }
      });
});

1条回答
smile是对你的礼貌
2楼-- · 2020-04-08 13:19

You can add the STROKE Property

pie: {               
  radius: 0.2,  
  innerRadius: 0.125,
  show: true,
  stroke: { 
      width: 0.1
  }
}

Set the value to 0 totally hide the pie.

So you could also add a stroke color, with the value set to the same color as your background :

pie: {
    radius: 0.2,
    innerRadius: 0.125,
    show: true,
    stroke: {
        width: 0.1,
        color: '#808080'
    }
}

See the Fiddle : http://jsfiddle.net/hSmVH/

查看更多
登录 后发表回答