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 2019/11/02 08:07:59 UTC

[GitHub] [incubator-echarts] natee edited a comment on issue #11017: 柱状图markArea覆盖不全

natee edited a comment on issue #11017: 柱状图markArea覆盖不全
URL: https://github.com/apache/incubator-echarts/issues/11017#issuecomment-549017252
 
 
   @Ovilia 
   graphic来解决这个问题是不是过于复杂,且rect.shape.width只能设置number,不支持百分比,当图形随浏览器变化时显示会错误
   
   我是通过设置x为百分比,来解决这个问题
   
   ```typescript
       let markAreaData: Array<any> = [];
       let left = 3; // grid.left
       let right = 3; // grid.right
       let len = series[0].data.length;
       let barWidth = (100-left-right)/len;
       for (let i = 0; i < len; i++) {
         if(condition){
           markAreaData.push(
             [{
               x: left + barWidth*i + '%',
               itemStyle:{
                 color:'rgba(255,0,0,0.06)'
               },
             }, {
               x: left + barWidth*(i+1) + '%'
             }]
           );
         }
       }
   ```

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