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/04/02 09:20:30 UTC

[GitHub] [echarts] yanxuequan opened a new issue #16827: Legend custom rich text style text horizontal alignment does not take effect[Bug]

yanxuequan opened a new issue #16827:
URL: https://github.com/apache/echarts/issues/16827


   ### Version
   
   Official website online example
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   
   option = {
     tooltip: {
       trigger: 'item'
     },
     icon: 'circle',
     legend: {
       top: '5%',
       left: '5%',
       orient: 'vertical',
       // align: 'right',
       itemWidth: 10,
       formatter: function (name) {
         return `{a|${name}:} {b|21.82%} {c|21.82万m³}`;
       },
       textStyle: {
         rich: {
           a: {
             backgroundColor: 'red',
             align: 'right',
             width: 150,
             color: '#ffffff'
           },
           b: {
             backgroundColor: 'green',
             align: 'right',
             width: 100,
             color: '#33E2FF'
           },
           c: {
             backgroundColor: 'blue',
             align: 'right',
             width: 100,
             color: '#33E2FF'
           }
         }
       }
     },
     series: [
       {
         name: 'Access From',
         type: 'pie',
         radius: ['40%', '70%'],
         avoidLabelOverlap: false,
         label: {
           show: false,
           position: 'center'
         },
         emphasis: {
           label: {
             show: true,
             fontSize: '40',
             fontWeight: 'bold'
           }
         },
         labelLine: {
           show: false
         },
         data: [
           { value: 1048, name: 'Search Engine' },
           { value: 735, name: 'Direct' },
           { value: 580, name: 'Email' },
           { value: 484, name: 'Union Ads' },
           { value: 300, name: 'Video Ads' }
         ]
       }
     ]
   };
   
   
   ### Current Behavior
   
   Both a and b styles are center aligned
   
   ![image](https://user-images.githubusercontent.com/16508918/161376372-8b3dc0a8-dff8-43f9-86b7-095f9d576d33.png)
   
   
   ### Expected Behavior
   
   Both a and b styles are right aligned
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


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