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 2021/03/18 12:55:29 UTC

[GitHub] [echarts] 89466598946659 opened a new issue #14502: treemap 设置 rich 后整体label不水平垂直居中

89466598946659 opened a new issue #14502:
URL: https://github.com/apache/echarts/issues/14502


   ### Version
   5.0.2
   
   ### Steps to reproduce
   1、打开地址:https://echarts.apache.org/examples/en/editor.html?c=treemap-disk
   2、输入以下option:
   
   ```javascript
   option = {
       series: [{
           type: 'treemap',
           name: '中国',
           leafDepth: 1,
           label: {
               formatter: '{b}',
               rich:{}, // 只要加上这句话,即使rich是空的,定位也会不居中
           },
           data: [{
               name: '河北省',            // First tree
               value: 10,
               children: [{
                   name: '邯郸市',       // First leaf of first tree
                   value: 4
               }, {
                   name: '保定市',       // Second leaf of first tree
                   value: 6
               }],
           }, {
               name: '河南省',            // Second tree
               value: 20,
               children: [{
                   name: '郑州市',       // Son of first tree
                   value: 20,
                   children: [{
                       name: 'xxx县',  // Granson of first tree
                       value: 20
                   }]
               }]
           }]
       }]
   };
   ```
   
   3、只要加上了 rich: {},即使是空的,label定位也有问题。不加的时候是水平垂直居中的,加上后变为lefttop 布局,设置 verticalAlign: "middle"  也不生效
   
   ### What is expected?
   希望“河北省”、“河南省”在块中是居中的
   
   ### What is actually happening?
   实际上跑到左上角了
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


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



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


[GitHub] [echarts] kchjxxgh removed a comment on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
kchjxxgh removed a comment on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-802726400


   Met the same issue after upgrade to 5.0.2. The rich with verticalAlign: middle doesn't work. 


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



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


[GitHub] [echarts] 89466598946659 commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
89466598946659 commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-806345618


   > @89466598946659
   > It is a option problem.
   > Try the following configuration.
   > 
   > ```js
   > {
   >         series: [{
   >                 type: 'treemap',
   >                 name: '中国',
   >                 leafDepth: 1,
   >                 label: {
   >                     position: ['50%', '50%'], // I think it will help you
   >                     formatter: '{b}',
   >                     rich:{}, 
   >                 },
   >                 data: [{
   >                     name: '河北省',            // First tree
   >                     value: 10,
   >                     children: [{
   >                         name: '邯郸市',       // First leaf of first tree
   >                         value: 4
   >                     }, {
   >                         name: '保定市',       // Second leaf of first tree
   >                         value: 6
   >                     }],
   >                 }, {
   >                     name: '河南省',            // Second tree
   >                     value: 20,
   >                     children: [{
   >                         name: '郑州市',       // Son of first tree
   >                         value: 20,
   >                         children: [{
   >                             name: 'xxx县',  // Granson of first tree
   >                             value: 20
   >                         }]
   >                     }]
   >                 }]
   >             }]
   >     }
   > ```
   
   thanks, really, I have two questions for this.
   first: The lable is not align center
   second: What I want is the red rect. to the yellow rect.
   ![Snipaste_2021-03-25_11-50-22](https://user-images.githubusercontent.com/12093931/112416827-6887b380-8d61-11eb-98b4-be78d77dcfbd.png)
   ![Snipaste_2021-03-25_11-52-51](https://user-images.githubusercontent.com/12093931/112416835-6d4c6780-8d61-11eb-8944-c8ceb18b144b.png)
   


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



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


[GitHub] [echarts] zhanghaoStart edited a comment on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
zhanghaoStart edited a comment on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-804657977


   @89466598946659 
   It is a option problem.
   Try the following configuration.
   {
           series: [{
                   type: 'treemap',
                   name: '中国',
                   leafDepth: 1,
                   label: {
                       position: ['50%', '50%'], // I think it will help you
                       formatter: '{b}',
                       rich:{}, 
                   },
                   data: [{
                       name: '河北省',            // First tree
                       value: 10,
                       children: [{
                           name: '邯郸市',       // First leaf of first tree
                           value: 4
                       }, {
                           name: '保定市',       // Second leaf of first tree
                           value: 6
                       }],
                   }, {
                       name: '河南省',            // Second tree
                       value: 20,
                       children: [{
                           name: '郑州市',       // Son of first tree
                           value: 20,
                           children: [{
                               name: 'xxx县',  // Granson of first tree
                               value: 20
                           }]
                       }]
                   }]
               }]
       }


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



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


[GitHub] [echarts] zhanghaoStart commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
zhanghaoStart commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-804657977


   @89466598946659 
   It is a option problem.
   Try the following configuration。
   {
           series: [{
                   type: 'treemap',
                   name: '中国',
                   leafDepth: 1,
                   label: {
                       position: ['50%', '50%'], // I think it will help you
                       formatter: '{b}',
                       rich:{}, 
                   },
                   data: [{
                       name: '河北省',            // First tree
                       value: 10,
                       children: [{
                           name: '邯郸市',       // First leaf of first tree
                           value: 4
                       }, {
                           name: '保定市',       // Second leaf of first tree
                           value: 6
                       }],
                   }, {
                       name: '河南省',            // Second tree
                       value: 20,
                       children: [{
                           name: '郑州市',       // Son of first tree
                           value: 20,
                           children: [{
                               name: 'xxx县',  // Granson of first tree
                               value: 20
                           }]
                       }]
                   }]
               }]
       }


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



---------------------------------------------------------------------
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 issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-801902879






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



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


[GitHub] [echarts] 89466598946659 commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
89466598946659 commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-1072214286


   > I have the same problem, is there a solution?
   
   No solution. Change another charts.😂


-- 
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] 89466598946659 commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
89466598946659 commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-806344871


   [](url)
   
   > Get a solution (the verticalAlign is 'top' by default):
   > ` labelLayout: (params) => { return { y: params.labelRect.y, align: 'center', } },`
   
   thanks,but what I want is like this: the label words in the red rect.
   ![Snipaste_2021-03-25_11-54-23](https://user-images.githubusercontent.com/12093931/112416628-00d16880-8d61-11eb-9838-505e4021ff71.png)
   


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



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


[GitHub] [echarts] 89466598946659 commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
89466598946659 commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-801905845


   I'm really need the rich function, it is very important to me, please give some answer~


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



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


[GitHub] [echarts] 89466598946659 commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
89466598946659 commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-1072214286


   > I have the same problem, is there a solution?
   
   No solution. Change another charts.😂


-- 
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] 89466598946659 commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
89466598946659 commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-1070251308


   您的邮件已收到!O(∩_∩)O!--------Pan


-- 
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] zhanghaoStart edited a comment on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
zhanghaoStart edited a comment on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-804657977


   @89466598946659 
   It is a option problem.
   Try the following configuration.
   ```js
   {
           series: [{
                   type: 'treemap',
                   name: '中国',
                   leafDepth: 1,
                   label: {
                       position: ['50%', '50%'], // I think it will help you
                       formatter: '{b}',
                       rich:{}, 
                   },
                   data: [{
                       name: '河北省',            // First tree
                       value: 10,
                       children: [{
                           name: '邯郸市',       // First leaf of first tree
                           value: 4
                       }, {
                           name: '保定市',       // Second leaf of first tree
                           value: 6
                       }],
                   }, {
                       name: '河南省',            // Second tree
                       value: 20,
                       children: [{
                           name: '郑州市',       // Son of first tree
                           value: 20,
                           children: [{
                               name: 'xxx县',  // Granson of first tree
                               value: 20
                           }]
                       }]
                   }]
               }]
       }
   ```


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



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


[GitHub] [echarts] kchjxxgh commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
kchjxxgh commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-802726400


   Met the same issue after upgrade to 5.0.2. The rich with verticalAlign: middle doesn't work. 


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



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


[GitHub] [echarts] pissang commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-1078617959


   Looks the width and height are set to rectangle width and height to truncate texts in https://github.com/apache/echarts/blob/master/src/chart/treemap/TreemapView.ts#L1004 . But when using rich text it will also affect the layout.


-- 
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] chenxueling commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
chenxueling commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-1070249674


   I have the same problem, is there a solution?


-- 
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] kchjxxgh commented on issue #14502: treemap 设置 rich 后整体label不水平垂直居中

Posted by GitBox <gi...@apache.org>.
kchjxxgh commented on issue #14502:
URL: https://github.com/apache/echarts/issues/14502#issuecomment-803506121


   Get a solution (the verticalAlign is 'top' by default):
   `        labelLayout: (params) => {
             return {
               y: params.labelRect.y,
               align: 'center',
             }
           },`


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



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