spoojaj opened a new issue, #18191:
URL: https://github.com/apache/echarts/issues/18191

   ### What problem does this feature solve?
   
   Get different color for each brush area like given in the example below - 
   
   
![image](https://user-images.githubusercontent.com/93267110/213419704-934674c9-d39c-4bc4-a8c7-2df65884fce7.png)
   
   Right now we have option to set color for brush component but it is 
applicable for all brush.
   
   We need feature to provide diff colors for each area.
   
   Below is the code that we have tried for achieving above functionality. 
   
   function func(x) {
     x /= 10;
     return Math.random() * 22
   }
   function generateData() {
     let data = [];
     for (let i = 0; i <= 10; i += 0.1) {
       data.push([i, func(i)]);
     }
     return data;
   }
   let colors = ['red', 'green','yellow', 'blue'];
   option = {
     animation: false,
     toolbox: {
       feature: {
         dataZoom: {
           yAxisIndex: false
         },
         brush: {
           type: ['lineX', 'clear', 'keep']
         },
       }
     },
     brush: {
       xAxisIndex: 'all',
       brushLink: 'all',
       brushStyle: {
         color: 'white',
       },
       outOfBrush: {
         colorAlpha: 0.1
       }
     },
     graphic: {
       elements: [],
     },
     grid: {
       top: 100,
       left: 50,
       right: 40,
       bottom: 50
     },
     xAxis: {
       minorTick: {
         show: true
       },
       minorSplitLine: {
         show: true
       }
     },
     yAxis: {
       minorTick: {
         show: true
       },
       minorSplitLine: {
         show: true
       }
     },
     series: [
       {
         type: 'line',
         showSymbol: false,
         clip: true,
         data: generateData()
       }
     ]
   };
   
   let count = 0;
   
   myChart.on('brushEnd', function() {
       let newOption = option;
       newOption.brush.brushStyle.color = colors[count],
       count = count + 1;
       myChart.setOption(newOption);
   })
   
   
   
   
   ### What does the proposed API look like?
   
   NaN


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