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 2020/03/02 06:01:05 UTC

[GitHub] [incubator-echarts] Ovilia edited a comment on issue #11944: Axis label being outside of the canvas

Ovilia edited a comment on issue #11944: Axis label being outside of the canvas
URL: https://github.com/apache/incubator-echarts/issues/11944#issuecomment-593234336
 
 
   I found that there is an option [xAxis.data.textStyle.align](https://echarts.apache.org/zh/option.html#xAxis.data.textStyle.align) that can set the align of a single axis data label. So there are two options:
   
   1. For users who have such requirement, they can set the align value of the last element to be `'right'`:
   ```
       xAxis: {
           data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', {
               value: 'Satxxxxxxxxxxxxxxxxxxxxxxxy',
               textStyle: {
                   align: 'right'
               }
           }],
           axisLabel: {
               interval: 4,
               showMinLabel: true,
               showMaxLabel: true,
               align: 'left'
           }
       },
   ```
   Result:
   <img width="808" alt="屏幕快照 2020-03-02 13 58 19" src="https://user-images.githubusercontent.com/779050/75649502-3d31b280-5c8e-11ea-9b4f-75b8e8300f4b.png">
   
   
   2. We change the source code and set the last label to be `'right'` for all cases, or if the last label is larger than the given space.
   
   Apparently, setting the last label to be `'right'` for all cases is a bad solution for simple cases like:
   <img width="830" alt="屏幕快照 2020-03-02 13 52 09" src="https://user-images.githubusercontent.com/779050/75649357-d3190d80-5c8d-11ea-989b-8d9b57939360.png">
   
   
   I would suggest that we remain the logic simple and let the user decide whether they need to align the last label to right.  

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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