You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/07/04 09:36:40 UTC

[GitHub] [echarts] Ovilia opened a new pull request, #17311: fix(axis): fix time axis labels and ticks being overlapped

Ovilia opened a new pull request, #17311:
URL: https://github.com/apache/echarts/pull/17311

   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   Fix the cases when time axis labels and ticks being overlapped.
   
   ### Fixed issues
   
   #17198
   
   
   ## Details
   
   ### Before: What was the problem?
   
   Some of the labels are too close to each other.
   
   ### After: How does it behave after the fixing?
   
   Labels with larger level (e.g., year labels have larger levels than month labels) are first displayed and then display labels with smaller levels when there is enough space.
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [x] This PR doesn't relate to document changes
   - [ ] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   
   
   ## Misc
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### Other information
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang commented on pull request #17311: fix(axis): fix time axis labels and ticks being overlapped

Posted by GitBox <gi...@apache.org>.
pissang commented on PR #17311:
URL: https://github.com/apache/echarts/pull/17311#issuecomment-1173714000

   I'm not sure but this seems has been addressed in https://github.com/apache/echarts/pull/15583


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Ovilia commented on pull request #17311: fix(axis): fix time axis labels and ticks being overlapped

Posted by GitBox <gi...@apache.org>.
Ovilia commented on PR #17311:
URL: https://github.com/apache/echarts/pull/17311#issuecomment-1174672042

   @pissang If you think I'm on the right track, I can keep fixing this PR. For now, this PR has a problem that when calculating the bounding box of each label, the unparsed text is used. For example, `{primary|8th}` may be used to calculate the text width rather than `8th` so it may overkill the overlapping. This is also a bug for category axis labels.
   
   If you think it is not a big deal if the ticks are not always the same as the labels, we can keep the current code and discuss if it's better to make `hideOverlap: true` by default.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Ovilia commented on pull request #17311: fix(axis): fix time axis labels and ticks being overlapped

Posted by GitBox <gi...@apache.org>.
Ovilia commented on PR #17311:
URL: https://github.com/apache/echarts/pull/17311#issuecomment-1174667488

   <img width="217" alt="image" src="https://user-images.githubusercontent.com/779050/177263277-0b88524f-ac92-48a6-bfc7-3196db7c5443.png">
   
   https://github.com/apache/echarts/pull/15583 's fixing may have a potential problem that the ticks of the overlapped labels are not hidden, so that the ticks are not always the same with the labels. @pissang Do you think it a better idea to avoid overlapping as in this PR so that the ticks are always the same with the labels?
   
   And after the change in #15712, it requires `hideOverlap` to avoid overlap, but I think this should be a default behavior (or at least the default value of `hideOverlap` of the axis labels should be set to be `true`). This should not considered as backward compatibility because the overlapped labels are bugs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on pull request #17311: fix(axis): fix time axis labels and ticks being overlapped

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on PR #17311:
URL: https://github.com/apache/echarts/pull/17311#issuecomment-1323221978

   Document changes are required in this PR. Please also make a PR to [apache/echarts-doc](https://github.com/apache/echarts-doc) for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the `PR: awaiting doc` label.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on pull request #17311: fix(axis): fix time axis labels and ticks being overlapped

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on PR #17311:
URL: https://github.com/apache/echarts/pull/17311#issuecomment-1173591143

   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
   
   The pull request is marked to be `PR: author is committer` because you are a committer of this project.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang commented on pull request #17311: fix(axis): fix time axis labels and ticks being overlapped

Posted by GitBox <gi...@apache.org>.
pissang commented on PR #17311:
URL: https://github.com/apache/echarts/pull/17311#issuecomment-1179097091

   > https://github.com/apache/echarts/pull/15583 's fixing may have a potential problem that the ticks of the overlapped labels are not hidden, so that the ticks are not always the same with the labels. @pissang Do you think it a better idea to avoid overlapping as in this PR so that the ticks are always the same with the labels?
   
   Ticks lines can follow the visibility of labels. It should be easy. But the current design is not following it.
   
   > And after the change in https://github.com/apache/echarts/pull/15712, it requires hideOverlap to avoid overlap, but I think this should be a default behavior (or at least the default value of hideOverlap of the axis labels should be set to be true). This should not considered as backward compatibility because the overlapped labels are bugs.
   
   Adding an extra option is what I suggested. Because the overlapping issue is brought by the new time axis refactoring in the 5.0 version. The best way to fix it is to optimize the interval strategy of the new time axis. Current strategy may give too many ticks than the specified splitNumber. Hiding overlapped labels is just a workaround.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Ovilia commented on a diff in pull request #17311: fix(axis): fix time axis labels and ticks being overlapped

Posted by GitBox <gi...@apache.org>.
Ovilia commented on code in PR #17311:
URL: https://github.com/apache/echarts/pull/17311#discussion_r1029977152


##########
src/coord/Axis.ts:
##########
@@ -221,7 +221,8 @@ class Axis {
     }
 
     getViewLabels(): ReturnType<typeof createAxisLabels>['labels'] {
-        return createAxisLabels(this).labels;
+        const labels = createAxisLabels(this).labels;

Review Comment:
   This change should be reverted in later commits.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org