【问题标题】:Removing the white line between slices in Flot pie chart删除 Flot 饼图中切片之间的白线
【发布时间】:2013-09-13 10:36:58
【问题描述】:

如何删除Flotpie chartslicesbackground 之间的white line

My jsfiddle

如您所见:

我希望它看起来像那样(忽略我糟糕的艺术技巧):

我的代码:

$(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
          }
        }
      });
});

【问题讨论】:

标签: jquery jquery-plugins charts flot pie-chart


【解决方案1】:

您可以添加 STROKE 属性

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

将值设置为 0 完全隐藏饼图。

因此您还可以添加笔触颜色,并将值设置为与背景相同的颜色:

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

见小提琴:http://jsfiddle.net/hSmVH/

【讨论】:

  • 或者只是添加 -- color: 'none'
  • 设置 width:0 不起作用,它显示 1px 的边框。设置 color:'none' 会导致甜甜圈的洞消失并再次恢复为完整的馅饼。此外 width:0.1 仍然显示大于 200px 直径的圆环图的边框,随着圆环图变大,这种情况会变得更糟。
  • 我认为设置笔画宽度:0 确实有效,这已在比我使用的新版本的 Flot 中得到修复
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多