You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/09/21 06:40:54 UTC
[GitHub] Ovilia commented on a change in pull request #8759: Enhance funnel
chart label display policy
Ovilia commented on a change in pull request #8759: Enhance funnel chart label display policy
URL: https://github.com/apache/incubator-echarts/pull/8759#discussion_r219396177
##########
File path: src/chart/funnel/funnelLayout.js
##########
@@ -71,9 +71,19 @@ function labelLayout(data) {
var linePoints;
if (isLabelInside) {
- 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') {
+ textX = (points[0][0] + points[3][0]) / 2 + 5;
+ textY = (points[0][1] + points[3][1]) / 2;
+ textAlign = 'left';
+ }else if (labelPosition === 'insideRight') {
+ textX = (points[1][0] + points[2][0]) / 2 - 5;
+ textY = (points[1][1] + points[2][1]) / 2;
+ textAlign = 'right';
+ }else {
Review comment:
`} else {`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org