Ovilia commented on issue #9201: 柱状图一组数据(根据正负值)显示在同一水平线上不同颜色(显示同一方向)
URL: 
https://github.com/apache/incubator-echarts/issues/9201#issuecomment-429189397
 
 
   ```js
   var data = [12, 22, -10, -5, 11, 31];
   
   var displayData = data.map(v => Math.abs(v));
   
   option = {
       xAxis: {
           data: ['a', 'b', 'c', 'd', 'e', 'f']
       },
       yAxis: {
           
       },
       series: {
           name: 'aa',
           type: 'bar',
           data: displayData,
           itemStyle: {
               color: function(p) {console.log(p)
                   return data[p.dataIndex] > 0 ? '#eb3d42' : '#00802d';
               }
           }
       }
   }
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to