Removing the white line between slices in Flot pie chart

喜你入骨 提交于 2019-12-20 01:39:08

问题


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:

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

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:


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/



来源:https://stackoverflow.com/questions/18784246/removing-the-white-line-between-slices-in-flot-pie-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!