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 2021/02/01 08:12:02 UTC

[GitHub] [echarts] NeroMorto opened a new issue #14167: Question about visualMap and series-line.areaStyle

NeroMorto opened a new issue #14167:
URL: https://github.com/apache/echarts/issues/14167


   ### Version
   5.0.1
   
   ### Reproduction link
   [https://codepen.io/NeroMorto/pen/dyOPjbx](https://codepen.io/NeroMorto/pen/dyOPjbx)
   
   ### Steps to reproduce
   Hello everyone! I have a question about visualMap.
   I have a line chart with two thresholds: upper and lower. I need to highlight areas above upper threshold and under lower threshold at same time, but i can't find a way to do it. Upper area can be highlighted by default - there is no problem, lower area not a problem with series-line.areaStyle.origin = 'end'. But is there a way to do both cases it at the same time?
   
   ### What is expected?
   ![2 screenshots combination](https://i.ibb.co/v3gJRWP/issue.jpg)
   
   ### What is actually happening?
   I cannot combine upper and lower area at same time
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] NeroMorto commented on issue #14167: Question about visualMap and series-line.areaStyle

Posted by GitBox <gi...@apache.org>.
NeroMorto commented on issue #14167:
URL: https://github.com/apache/echarts/issues/14167#issuecomment-787678804


   @Ovilia Thanks a lot for answer! I thought about this case with two datasets, but I'm think it may cause performance issues in my case with many charts on page on same time. But I'll try it anyway, thx again! 


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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] NeroMorto closed issue #14167: Question about visualMap and series-line.areaStyle

Posted by GitBox <gi...@apache.org>.
NeroMorto closed issue #14167:
URL: https://github.com/apache/echarts/issues/14167


   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #14167: Question about visualMap and series-line.areaStyle

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14167:
URL: https://github.com/apache/echarts/issues/14167#issuecomment-770660729


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Ovilia commented on issue #14167: Question about visualMap and series-line.areaStyle

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #14167:
URL: https://github.com/apache/echarts/issues/14167#issuecomment-783411191


   A walk-around:
   
   ```js
   var realData = [150, 230, 224, 218, 135, 147, 260];
   var max = realData.reduce(function (a, b) {
       return Math.max(a, b);
   }, -1);
   var min = realData.reduce(function (a, b) {
       return Math.min(a, b);
   }, max);
   var yAxisMax = 300;
   
   var thretholdHigh = 190;
   var rateHigh = 1 - thretholdHigh / max;
   var thretholdLow = 170;
   var rateLow = (yAxisMax - thretholdLow) / (yAxisMax - min);
   
   option = {
       xAxis: {
           type: 'category',
           data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
       },
       yAxis: {
           type: 'value',
           max: yAxisMax
       },
       color: 'blue',
       series: [{
           data: realData,
           type: 'line',
           areaStyle: {
               // origin: 'start'
               color: {
                   type: 'linear',
                   x: 0,
                   y: 0,
                   x2: 0,
                   y2: 1,
                   colorStops: [{
                       offset: 0, color: 'blue'
                   }, {
                       offset: rateHigh, color: 'blue'
                   }, {
                       offset: rateHigh + 0.001, color: 'transparent'
                   }],
               }
           },
           z: 10
       }, {
           data: realData,
           type: 'line',
           showSymbol: false, // hide data item circle
           lineStyle: {
               width: 0 // hide line  
           },
           areaStyle: {
               origin: 'end',
               color: {
                   type: 'linear',
                   x: 0,
                   y: 0,
                   x2: 0,
                   y2: 1,
                   colorStops: [{
                       offset: 0, color: 'transparent'
                   }, {
                       offset: rateLow, color: 'transparent'
                   }, {
                       offset: rateLow + 0.001, color: 'red'
                   }],
               }
           }
       }]
   };
   ```


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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org