-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
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
Enhance funnel chart label display policy #8759
Conversation
漏斗图中的label是否可以支持position等于insideLeft和insideRight #7596 |
@cuijian-dexter Hi @cuijian-dexter , I think this feature is very useful although we have to discuss it in details. But first of all, could you please change the title and comments into English so that more community members can understand? Thanks! |
@Ovilia ok,I'll change it right away |
src/chart/funnel/funnelLayout.js
Outdated
textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; | ||
textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; | ||
textAlign = 'center'; | ||
if (labelPosition === 'insideLeft'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space: if (labelPosition === 'insideLeft') {
.
Also change the similar problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,thank you
src/chart/funnel/funnelLayout.js
Outdated
textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; | ||
textAlign = 'center'; | ||
if (labelPosition === 'insideLeft'){ | ||
textX = (points[0][0] + points[3][0])/2 + 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) / 2
@cuijian-dexter The pie chart label filtering and funnel label positioning seems to be two different topics. I reviewed the funnel part and that seems to be working. How about removing the pie chart part in this PR (you can make another PR later)? |
@Ovilia options = {
title: {
text: '饼图标题',
left: 16,
textStyle: {
fontSize: 14
}
},
tooltip : {
trigger: 'item',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
extraCssText: 'max-width: 300px; word-break:break-all; white-space: normal'
},
legend:{
data: []
},
series: [
{
type: 'pie',
label: {
normal: {
show: true,
limitScale:0.02//小于2%的,不显示
},
emphasis: {
show: true,
textStyle: {
fontSize: '14',
fontWeight: 'bold'
}
}
},
labelLine: {
lineStyle: {
// color: '#D9D9D9'
}
},
data: []
}
]
}; |
You need to remove the pie-related code from the PR. Undo the changes in pie chart; commit; pull request. |
@Ovilia Okay, I have deleted the pie-related code. |
@cuijian-dexter Very close now! Please see https://github.com/apache/incubator-echarts/pull/8759/files for my comments and fix them. And revert the changes in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funnel plot position increase insideLeft and insideRight attributes.
src/chart/funnel/funnelLayout.js
Outdated
textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; | ||
textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; | ||
textAlign = 'center'; | ||
if (labelPosition === 'insideLeft'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,thank you
@Ovilia should I delete this file src/chart/pie/pieLayout.js ? |
@Ovilia It seems to be OK. I'm very sorry, this is my first time to contribute code, not very skilled. |
Please don't be sorry. That's OK and we very appreciate your contribution. |
@Ovilia ok, Already fixed the code style.Add space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more changes.. I believe they are the last ones. 😄
src/chart/funnel/funnelLayout.js
Outdated
textX = (points[0][0] + points[3][0]) / 2 + 5; | ||
textY = (points[0][1] + points[3][1]) / 2; | ||
textAlign = 'left'; | ||
}else if (labelPosition === 'insideRight') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be } else if
src/chart/funnel/funnelLayout.js
Outdated
textX = (points[1][0] + points[2][0]) / 2 - 5; | ||
textY = (points[1][1] + points[2][1]) / 2; | ||
textAlign = 'right'; | ||
}else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else {
@Ovilia Have already been solved |
@cuijian-dexter Thanks for your contribution! 🌟🌟🌟🌟🌟 And are you interested in being an ECharts committer? This has more restrict rules than contributors. Committers are those who contribute more frequently and play more important roles on ECharts project. After being a committer:
If you are interested, here's what you can do:
Here are some issues that may be easier to be fixed: https://github.com/apache/incubator-echarts/projects/3 And you will be invited to be a committer when we think your contribution and knowledge of ECharts project is enough. We are looking forward to this! 😃 |
@Ovilia Thank you |
@cuijian-dexter Thanks, please send scanned PDF as soon as possible. ⭐️ |
@Ovilia It has been sent the scanned file to dev@echarts.apache.org.Please check it. |
@cuijian-dexter Sorry for the late reply. I didn't receive the file from dev@echarts.apache.org. |
@Ovilia ok |
I've sent the email but the secretary did not reply. There are some other new contributors sending ICLA file and got no reply. I'll send an email to mentor about this. |
@Ovilia ok |
Now,what should I do? |
I got an email that your ICLA file has been accepted. Congratulations! |
@Ovilia Thank you!😄 |
Add the limitScale parameter under series. Label, and the parameter value is greater than 0 and less than 1.
To ensure that the pie chart does not show label and labelLine on the fan page that is less than a certain value.