We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.4.0
https://codepen.io/chiyu1996/pen/RwyqoEy
var chartDom = document.getElementById('main'); var myChart = echarts.init(chartDom); var option;
option = { tooltip: { trigger: 'item', formatter: '{a} {b}: {c} ({d}%)' }, legend: { data: [ 'Direct', 'Marketing', 'Search Engine', 'Email', 'Union Ads', 'Video Ads', 'Baidu', 'Google', 'Bing', 'Others' ] }, series: [ { name: 'Access From', type: 'pie', selectedMode: 'single', radius: [0, '30%'], label: { position: 'inner', fontSize: 14 }, labelLine: { show: false }, data: [ { value: 1548, name: 'Search Engine' }, { value: 775, name: 'Direct' }, { value: 679, name: 'Marketing', selected: true } ] }, { name: 'Access From', type: 'pie', radius: ['45%', '60%'], labelLine: { length: 30 }, label: { formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ', backgroundColor: '#F6F8FC', borderColor: '#8C8D8E', borderWidth: 1, borderRadius: 4, rich: { a: { color: '#6E7079', lineHeight: 22, align: 'center' }, hr: { borderColor: '#8C8D8E', width: '100%', borderWidth: 1, height: 0 }, b: { color: '#4C5058', fontSize: 14, fontWeight: 'bold', lineHeight: 33 }, per: { color: '#fff', backgroundColor: '#4C5058', padding: [3, 4], borderRadius: 4 } } }, data: [ { value: 0, name: 'Baidu' }, { value: 0, name: 'Direct' }, { value: 0, name: 'Email' }, { value: 0, name: 'Google' }, { value: 0, name: 'Union Ads' }, { value: 0, name: 'Bing' }, { value: 0, name: 'Video Ads' }, { value: 0, name: 'Others' } ] } ] };
option && myChart.setOption(option);
When all pie chart data are 0, the percentage is displayed as undefined
in v5.3.3, the percentage is displayed as 0
- OS: - Browser: - Framework:
No response
The text was updated successfully, but these errors were encountered:
Thanks for your feedback. This bug has been fixed in #17734.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Version
5.4.0
Link to Minimal Reproduction
https://codepen.io/chiyu1996/pen/RwyqoEy
Steps to Reproduce
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
option = {
tooltip: {
trigger: 'item',
formatter: '{a}
{b}: {c} ({d}%)'
},
legend: {
data: [
'Direct',
'Marketing',
'Search Engine',
'Email',
'Union Ads',
'Video Ads',
'Baidu',
'Google',
'Bing',
'Others'
]
},
series: [
{
name: 'Access From',
type: 'pie',
selectedMode: 'single',
radius: [0, '30%'],
label: {
position: 'inner',
fontSize: 14
},
labelLine: {
show: false
},
data: [
{ value: 1548, name: 'Search Engine' },
{ value: 775, name: 'Direct' },
{ value: 679, name: 'Marketing', selected: true }
]
},
{
name: 'Access From',
type: 'pie',
radius: ['45%', '60%'],
labelLine: {
length: 30
},
label: {
formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ',
backgroundColor: '#F6F8FC',
borderColor: '#8C8D8E',
borderWidth: 1,
borderRadius: 4,
rich: {
a: {
color: '#6E7079',
lineHeight: 22,
align: 'center'
},
hr: {
borderColor: '#8C8D8E',
width: '100%',
borderWidth: 1,
height: 0
},
b: {
color: '#4C5058',
fontSize: 14,
fontWeight: 'bold',
lineHeight: 33
},
per: {
color: '#fff',
backgroundColor: '#4C5058',
padding: [3, 4],
borderRadius: 4
}
}
},
data: [
{ value: 0, name: 'Baidu' },
{ value: 0, name: 'Direct' },
{ value: 0, name: 'Email' },
{ value: 0, name: 'Google' },
{ value: 0, name: 'Union Ads' },
{ value: 0, name: 'Bing' },
{ value: 0, name: 'Video Ads' },
{ value: 0, name: 'Others' }
]
}
]
};
option && myChart.setOption(option);
Current Behavior
When all pie chart data are 0, the percentage is displayed as undefined
Expected Behavior
in v5.3.3, the percentage is displayed as 0
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: