In this issue, I have provided information with: 在这个 issue 中我提供了以下信息:
在echart 4.0版本中,series type 为pie 时,使用startAngle和endAngle设置起始刻度无效,
使用pie绘制出半圆环形图
配置项无效果
option = {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
legend: {
orient: 'vertical',
x: 'left',
data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
},
series: [
{
name:'访问来源',
type:'pie',
radius: ['50%', '70%'],
startAngle:0,
endAngle:180,
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data:[
{value:335, name:'直接访问'},
{value:310, name:'邮件营销'},
{value:234, name:'联盟广告'},
{value:135, name:'视频广告'},
{value:1548, name:'搜索引擎'}
]
}
]
};
echart 4.2
endAngle is not supported in pie chart yet.
endAngle is not supported in pie chart yet.
thanks for reply,and can i know how to draw a half-circle ring? just use 'startAngle' in the 'pie' or ??
A tricky way:
option = {
series : [
{
type: 'pie',
radius : '55%',
data:[
{value:335, name:'AA'},
{value:310, name:'BB'},
{value:234, name:'CC'},
{value:135, name:'DD'},
{value:1548, name:'empty', silent: true, itemStyle: {color: 'rgba(0,0,0,0)'}}
]
}
]
};
A tricky way:
option = { series : [ { type: 'pie', radius : '55%', data:[ {value:335, name:'AA'}, {value:310, name:'BB'}, {value:234, name:'CC'}, {value:135, name:'DD'}, {value:1548, name:'empty', silent: true, itemStyle: {color: 'rgba(0,0,0,0)'}} ] } ] };
not bad, but still has a question,can't use 'tooltip' in 'option'.if i do, the 'empty' tooltip will be show when i hover it。anyway,thank you for reply
@JohnsonWQ
Support tooltip:
option = {
tooltip: {
formatter: function (params) {
if (params && params.name === 'empty') {
return;
}
return ''
+ echarts.format.getTooltipMarker(params.color)
+ params.name + ': ' + params.value
+ ' (' + params.percent + '%)';
}
},
series : [
{
type: 'pie',
radius : '55%',
data:[
{value:335, name:'AA'},
{value:310, name:'BB'},
{value:234, name:'CC'},
{value:135, name:'DD'},
{value:1548, name:'empty', silent: true, itemStyle: {color: 'rgba(0,0,0,0)'}}
]
}
]
};
Most helpful comment
@JohnsonWQ
Support tooltip: