You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/04/08 08:22:35 UTC

[GitHub] Adelaide1014 commented on issue #4667: ���������������������������������������������������������������

Adelaide1014 commented on issue #4667: 如何在柱状图给最大值和最小值设置不同的颜色
URL: https://github.com/apache/incubator-echarts/issues/4667#issuecomment-379530823
 
 
   ECharts version [ECharts 版本]: 3.0版本中:
   <pre>            itemStyle:{
                   normal:{
                       color:'orange' 
                   },
                   emphasis:{
                       color:'purple' 
                   }
               },</pre>
   是用来设置正常显示与鼠标悬停等高亮时的状态,不是用来设置最大值最小值是的颜色
   
   <pre>
   function getColor(value){
       console.log(value)
       if(value=='max'){
           return 'red';
       }else{
           return 'green';
       }
   }
   
       series : [
           {
               name:'直接访问',
               type:'bar',
               barWidth: '60%',
               itemStyle:{
                   normal:{//正常
                       color:'orange' 
                   },
                   emphasis:{//高亮鼠标悬浮
                       color:'purple' 
                   }
               },
               data:[{
                   value:10,
                   itemStyle:{//直接专递是否最大值
                    color:getColor('min')
                     
                   }
               }, {
                   value:52,
                   itemStyle:{
                         color:getColor('max')
                   }
               }, {
                   value:22,
                   itemStyle:{
                         //color:getColor('max')
                   }
               }]
           }
       ]
   </pre>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org