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/06/16 23:49:02 UTC

[GitHub] [echarts] marmelo opened a new pull request, #17231: fix(label): propagate the lineOverflow label option. close #14506

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

   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   ### What does this PR do?
   
   Allows to truncate labels that overflow multiple lines by propagating the `lineOverflow` label option to ZRender.
   
   ### Fixed issues
   
   - #14506
   - #15248
   
   
   ## Details
   
   ### Before: What was the problem?
   
   It was not possible to limit the number of lines in labels.
   ![2022-06-17-003410_685x367_scrot](https://user-images.githubusercontent.com/247440/174195384-cc782c7e-67aa-4a52-b562-8ca6046be29e.png)
   
   ### After: How does it behave after the fixing?
   
   Please assume the following configuration:
   
   ```js
   {
       ...
       xAxis: {
           ...
           axisLabel: {
               ...
               width: 80,  // both width and height are required
               height: 30,  // twice the line height, so only 2 lines are displayed
               lineHeight: 15,
               overflow: 'break',
               lineOverflow: 'truncate'  // the option that is now being propagated
           }
       }
   }
   ```
   
   ![2022-06-17-003359_683x343_scrot](https://user-images.githubusercontent.com/247440/174195568-965387ab-9053-442d-b13e-78924e402bf1.png)
   
   Please check `axisLabel-lineOverflow.html` visual test case for more details.
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [ ] This PR doesn't relate to document changes
   - [x] 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
   
   - Visual test case `axisLabel-lineOverflow.html` was added.
   
   
   ## Others
   
   ### Merging options
   
   - [x] 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] plainheart commented on pull request #17231: fix(label): propagate the lineOverflow label option. close #14506

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

   There is two similar PRs #15404, #14214. A member, @pissang, who implemented this function, said, 
   > `ellipsis` and `lineOverflow` are not supported in the labels.
   
   > For `lineOverflow` it's mainly because I thought it is not implemented well yet.
   


-- 
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 #17231: fix(label): propagate the lineOverflow label option. close #14506

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

   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).
   
   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] marmelo commented on pull request #17231: fix(label): propagate the lineOverflow label option. close #14506

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

   Hi @plainheart, I agree the PRs are similar but they are old and eventually been closed.
   Can you please advise how to push this change through?
   
   About ellipsis, if we try to override the ellipsis string (`...` by default) also does not work.
   The fix is similar, the `ellipsis` option is not being propagated to ZRender.
   I can add this fix to the current PR or create a new one.
   
   Also, `ellipsis` option only works if we have a single row of text.
   If we have more than one row (like the example in this issue description) the ellipsis will not be rendered.
   This is a missing feature of ZRender, not an ECharts issue.


-- 
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