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/22 02:23:56 UTC

[GitHub] [echarts] zhangjianrencai opened a new issue #14508: v5.0.2 legend.textStyle.rich.{className}.width can't work

zhangjianrencai opened a new issue #14508:
URL: https://github.com/apache/echarts/issues/14508


   ### Version
   5.0.2
   
   ### Steps to reproduce
   1. install v5.0.2
   2. construct the following option
   option = {
       title: {
           text: '某站点用户访问来源',
           subtext: '纯属虚构',
           left: 'center'
       },
       tooltip: {
           trigger: 'item'
       },
       legend: {
           orient: 'horizontal',
           width: '200',
           left: 'left',
           textStyle: {
             fontSize: 14,
             color: '#5A6872',
             rich: {
               a: {
                 width: 100
               }
             }
           },
           formatter: function (name) {
             return '{a|'  name '}'
           },
       },
       series: [
           {
               name: '访问来源',
               type: 'pie',
               radius: '50%',
               data: [
                   {value: 1048, name: '搜索引擎'},
                   {value: 735, name: '直接访问'},
                   {value: 580, name: '邮件营销'},
                   {value: 484, name: '联盟广告'},
                   {value: 300, name: '视频广告'}
               ],
               emphasis: {
                   itemStyle: {
                       shadowBlur: 10,
                       shadowOffsetX: 0,
                       shadowColor: 'rgba(0, 0, 0, 0.5)'
                   }
               }
           }
       ]
   };
   
   ### What is expected?
   the legend text width will be 100
   
   ### What is actually happening?
   the legend text width is not 100
   
   <!-- 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] zhanghaoStart commented on issue #14508: v5.0.2 legend.textStyle.rich.{className}.width can't work

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


   @100pah 
   I think it's a code problem.
   A transparent default value for the legend.textStyle.rich.[styleName].backgroundColor will solve this problem.
   ![image](https://user-images.githubusercontent.com/50821278/111960909-4dcbf980-8b2b-11eb-8a02-88a8f7bb6c74.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 removed a comment on issue #14508: v5.0.2 legend.textStyle.rich.{className}.width can't work

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


   @100pah 
   I think it's a code problem.
   A transparent default value for the legend.textStyle.rich.[styleName].backgroundColor will solve this problem.
   ![image](https://user-images.githubusercontent.com/50821278/111960909-4dcbf980-8b2b-11eb-8a02-88a8f7bb6c74.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] 100pah commented on issue #14508: v5.0.2 legend.textStyle.rich.{className}.width can't work

Posted by GitBox <gi...@apache.org>.
100pah commented on issue #14508:
URL: https://github.com/apache/echarts/issues/14508#issuecomment-803795554


   @zhangjianrencai 
   The width of that text block has been 100.
   Please check this:
   ```js
   option = {
       title: {
           text: '某站点用户访问来源',
           subtext: '纯属虚构',
           left: 'center'
       },
       tooltip: {
           trigger: 'item'
       },
       legend: {
           orient: 'horizontal',
           width: '200',
           left: 'left',
           textStyle: {
             fontSize: 14,
             color: '#5A6872',
             rich: {
               a: {
                 width: 100,
                 backgroundColor: 'red', // show the text block
                 align: 'center'                  // might be what you need?
               }
             }
           },
           formatter: function (name) {
             return '{a|' +  name+  '}';
           },
       },
       series: [
           {
               name: '访问来源',
               type: 'pie',
               radius: '50%',
               data: [
                   {value: 1048, name: '搜索引擎'},
                   {value: 735, name: '直接访问'},
                   {value: 580, name: '邮件营销'},
                   {value: 484, name: '联盟广告'},
                   {value: 300, name: '视频广告'}
               ],
               emphasis: {
                   itemStyle: {
                       shadowBlur: 10,
                       shadowOffsetX: 0,
                       shadowColor: 'rgba(0, 0, 0, 0.5)'
                   }
               }
           }
       ]
   };
   ```


-- 
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 #14508: v5.0.2 legend.textStyle.rich.{className}.width can't work

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


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


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