jiawulin001 commented on issue #17222:
URL: https://github.com/apache/echarts/issues/17222#issuecomment-1156376829

   You don't need a new feature to do this. Try using [**Template 
String**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
 which allows you to use `${expression}` in string.
   You can refer to the demo below and try altering the value of `num`:
   <details>
   <summary>Code Sample</summary>
   
   ```
   const num = -5;
   option = {
     xAxis: {
       type: 'category',
       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
     },
     yAxis: {
       type: 'value'
     },
     series: [
       {
         data: [120, 200, 150, 80, 70, 110, 130],
         type: 'bar',
         showBackground: true,
         backgroundStyle: {
           color: 'rgba(180, 180, 180, 0.2)'
         },
         label:{
           show: true,
           color:`${num > 0 ? 'red' : 'blue'}`
         }
       }
     ]
   };
   ```
   </details>


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

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to