How to make pie chart with data border radius in highchart

不打扰是莪最后的温柔 提交于 2019-12-02 08:35:41

I do not think a pie can have rounded corners without modifying internal Highcharts code. However, you can achieve the desired result with a solidgauge chart with some trickery - this type of chart has property to set rounded/square caps - solidgauge.linecap.

var gaugeOptions = {

chart: {
  type: 'solidgauge'
},

yAxis: {
  visible: false,
  min: 0,
  max: 2
},

tooltip: {
  enabled: false
},

plotOptions: {
  solidgauge: {
    dataLabels: {
      enabled: false
    },
    borderColor: '#0883ce',
    borderWidth: 15,
    radius: '100%',
    innerRadius: '100%'
  }
},
series: [{
  borderColor: '#b9b9b9',
  borderWidth: 14,
  data: [1.5]
}, {
  data: [0],
  enableMouseTracking: false
}, {
  data: [1],
  linecap: 'square'
}]
};

Live example and output

http://jsfiddle.net/Penstrife/1s8sfqtn/

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