How to remove fine white line between halo and Highcharts pie chart

故事扮演 提交于 2019-12-11 19:06:37

问题


http://jsfiddle.net/0bpkrnd3/4/ demonstrates that there is a very fine white line between the hover halo of a Highcharts pie chart and the pie segment. The halo color is as the same as the hover color and its stroke width is 0.

pie: {
  shadow: false,
    borderWidth: 0,
    states: {
    hover: {
      color: '#ff7f00',
        brightness: 0,
        lineWidth: 0,
        halo: {
        size: 9,
          opacity: 1,
          attributes: {
          fill: '#ff7f00',
            'stroke-width': 0
        }
      }

    }
  }
}


回答1:


This is anty-aliasing in SVG. You can play around with different options using shape-rendering CSS option: http://jsfiddle.net/0bpkrnd3/5/ (crispEdges looks even worse ;) )

Anyway, there is another solution you can use, instead of halo. Simply disable halo and use point.events to change radius of the slice: http://jsfiddle.net/0bpkrnd3/6/

Code:

    point: {
      events: {
        mouseOver: function() {
          this.graphic.attr({
            r: this.shapeArgs.r + 10
          });
        },
        mouseOut: function() {
            this.graphic.attr({
            r: this.shapeArgs.r
          });
        }
      }
    },


来源:https://stackoverflow.com/questions/34309755/how-to-remove-fine-white-line-between-halo-and-highcharts-pie-chart

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