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 2020/03/27 03:50:38 UTC

[GitHub] [incubator-echarts] yanwencheng opened a new issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

yanwencheng opened a new issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336
 
 
   ### Version
   4.5.0
   
   ### Steps to reproduce
   series:[{
   ....
   type:'line'
   }]
   
   ### What is expected?
   能够显示圈选,非圈选效果
   
   ### What is actually happening?
   没有效果
   
   <!-- This issue is generated by echarts-issue-helper. 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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-604801078
 
 
   ```
   var upColor = '#00da3c';
   var downColor = '#ec0000';
   
   
   function splitData(rawData) {
       var categoryData = [];
       var values = [];
       var volumes = [];
       for (var i = 0; i < rawData.length; i++) {
           categoryData.push(rawData[i].splice(0, 1)[0]);
           values.push(rawData[i]);
           volumes.push([i, rawData[i][4], rawData[i][0] > rawData[i][1] ? 1 : -1]);
       }
   
       return {
           categoryData: categoryData,
           values: values,
           volumes: volumes
       };
   }
   
   function calculateMA(dayCount, data) {
       var result = [];
       for (var i = 0, len = data.values.length; i < len; i++) {
           if (i < dayCount) {
               result.push('-');
               continue;
           }
           var sum = 0;
           for (var j = 0; j < dayCount; j++) {
               sum += data.values[i - j][1];
           }
           result.push(+(sum / dayCount).toFixed(3));
       }
       return result;
   }
   
   $.get(ROOT_PATH + 'data/asset/data/stock-DJI.json', function (rawData) {
   
       var data = splitData(rawData);
   
       myChart.setOption(option = {
           backgroundColor: '#fff',
           animation: false,
           legend: {
               bottom: 10,
               left: 'center',
               data: ['Dow-Jones index', 'MA5', 'MA10', 'MA20', 'MA30']
           },
           tooltip: {
               trigger: 'axis',
               axisPointer: {
                   type: 'cross'
               },
               backgroundColor: 'rgba(245, 245, 245, 0.8)',
               borderWidth: 1,
               borderColor: '#ccc',
               padding: 10,
               textStyle: {
                   color: '#000'
               },
               position: function (pos, params, el, elRect, size) {
                   var obj = {top: 10};
                   obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30;
                   return obj;
               }
               // extraCssText: 'width: 170px'
           },
           axisPointer: {
               link: {xAxisIndex: 'all'},
               label: {
                   backgroundColor: '#777'
               }
           },
           toolbox: {
               feature: {
                   dataZoom: {
                       yAxisIndex: false
                   },
                   brush: {
                       type: ['lineX', 'clear']
                   }
               }
           },
           brush: {
               xAxisIndex: 'all',
               brushLink: 'all',
               outOfBrush: {
                   colorAlpha: 0.1
               }
           },
           visualMap: {
               show: false,
               seriesIndex: 5,
               dimension: 2,
               pieces: [{
                   value: 1,
                   color: downColor
               }, {
                   value: -1,
                   color: upColor
               }]
           },
           grid: [
               {
                   left: '10%',
                   right: '8%',
                   height: '50%'
               },
               {
                   left: '10%',
                   right: '8%',
                   top: '63%',
                   height: '16%'
               }
           ],
           xAxis: [
               {
                   type: 'category',
                   data: data.categoryData,
                   scale: true,
                   boundaryGap: false,
                   axisLine: {onZero: false},
                   splitLine: {show: false},
                   splitNumber: 20,
                   min: 'dataMin',
                   max: 'dataMax',
                   axisPointer: {
                       z: 100
                   }
               },
               {
                   type: 'category',
                   gridIndex: 1,
                   data: data.categoryData,
                   scale: true,
                   boundaryGap: false,
                   axisLine: {onZero: false},
                   axisTick: {show: false},
                   splitLine: {show: false},
                   axisLabel: {show: false},
                   splitNumber: 20,
                   min: 'dataMin',
                   max: 'dataMax'
               }
           ],
           yAxis: [
               {
                   scale: true,
                   splitArea: {
                       show: true
                   }
               },
               {
                   scale: true,
                   gridIndex: 1,
                   splitNumber: 2,
                   axisLabel: {show: false},
                   axisLine: {show: false},
                   axisTick: {show: false},
                   splitLine: {show: false}
               }
           ],
           dataZoom: [
               {
                   type: 'inside',
                   xAxisIndex: [0, 1],
                   start: 98,
                   end: 100
               },
               {
                   show: true,
                   xAxisIndex: [0, 1],
                   type: 'slider',
                   top: '85%',
                   start: 98,
                   end: 100
               }
           ],
           series: [
               {
                   name: 'Dow-Jones index',
                   type: 'line',
                   data: data.values,
                   itemStyle: {
                       color: upColor,
                       color0: downColor,
                       borderColor: null,
                       borderColor0: null
                   },
                   tooltip: {
                       formatter: function (param) {
                           param = param[0];
                           return [
                               'Date: ' + param.name + '<hr size=1 style="margin: 3px 0">',
                               'Open: ' + param.data[0] + '<br/>',
                               'Close: ' + param.data[1] + '<br/>',
                               'Lowest: ' + param.data[2] + '<br/>',
                               'Highest: ' + param.data[3] + '<br/>'
                           ].join('');
                       }
                   }
               },
               {
                   name: 'MA5',
                   type: 'line',
                   data: calculateMA(5, data),
                   smooth: true,
                   lineStyle: {
                       opacity: 0.5
                   }
               },
               {
                   name: 'MA10',
                   type: 'line',
                   data: calculateMA(10, data),
                   smooth: true,
                   lineStyle: {
                       opacity: 0.5
                   }
               },
               {
                   name: 'MA20',
                   type: 'line',
                   data: calculateMA(20, data),
                   smooth: true,
                   lineStyle: {
                       opacity: 0.5
                   }
               },
               {
                   name: 'MA30',
                   type: 'line',
                   data: calculateMA(30, data),
                   smooth: true,
                   lineStyle: {
                       opacity: 0.5
                   }
               },
               {
                   name: 'Volume',
                   type: 'bar',
                   xAxisIndex: 1,
                   yAxisIndex: 1,
                   data: data.volumes
               }
           ]
       }, true);
   
       myChart.dispatchAction({
           type: 'brush',
           areas: [
               {
                   brushType: 'lineX',
                   coordRange: ['2016-06-02', '2016-06-20'],
                   xAxisIndex: 0
               }
           ]
       });
   });
   ```

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-605393838
 
 
   > 代码没法直接运行,请提供一个在线复现的环境
   
   复现地址:https://gallery.echartsjs.com/editor.html?c=xsCZh7a-vE&v=2

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] yanwencheng edited a comment on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
yanwencheng edited a comment on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-604932313
 
 
   > @yanwencheng请通过https://jsfiddle.net/ovilia/n6xc4df3/或https://gallery.echartsjs.com/editor.html提供此问题的演示。
   
   复现地址:`https://gallery.echartsjs.com/editor.html?c=xsCZh7a-vE&v=2`

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-604840761
 
 
   代码没法直接运行,请提供一个在线复现的环境

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-607108503
 
 
   高亮:
   <img width="110" alt="屏幕快照 2020-04-01 16 24 09" src="https://user-images.githubusercontent.com/779050/78115482-74ce7e80-7435-11ea-9c28-8654f32fc021.png">
   
   非 brush 部分:
   <img width="164" alt="屏幕快照 2020-04-01 16 24 05" src="https://user-images.githubusercontent.com/779050/78115532-82840400-7435-11ea-9b66-02ef028c0741.png">
   

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-604932313
 
 
   > @yanwencheng请通过https://jsfiddle.net/ovilia/n6xc4df3/或https://gallery.echartsjs.com/editor.html提供此问题的演示。
   
   复现地址:https://gallery.echartsjs.com/editor.html?c=xsCZh7a-vE&v=2

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-607154066
 
 
   > 高亮:
   > <img alt="屏幕快照 2020-04-01 16 24 09" width="110" src="https://user-images.githubusercontent.com/779050/78115482-74ce7e80-7435-11ea-9c28-8654f32fc021.png">
   > 
   > 非 brush 部分:
   > <img alt="屏幕快照 2020-04-01 16 24 05" width="164" src="https://user-images.githubusercontent.com/779050/78115532-82840400-7435-11ea-9b66-02ef028c0741.png">
   
   修改了哪部分?为什么我配置后没有变化呢,能提供下代码学习下么

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-606375218
 
 
   > 你仔细看,其实是有效果的,只是对比不像柱状图一样强烈,所以容易看不清。可以通过改颜色加强对比。
   
   改颜色也没有效果,我是没看出来有什么变化

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-606369304
 
 
   你仔细看,其实是有效果的,只是对比不像柱状图一样强烈,所以容易看不清。可以通过改颜色加强对比。

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-604800885
 
 
   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 questions.
   
   If you are interested in the project, you may also subscribe our [mail 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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-605749313
 
 
   请对比参考:https://echarts.apache.org/examples/zh/editor.html?c=candlestick-brush

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
yanwencheng commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-605750302
 
 
   > 请对比参考:https://echarts.apache.org/examples/zh/editor.html?c=candlestick-brush
   
   就是这个实例,如果把      series.type改成line就没有效果了。
   同时我只是单纯的line图也没有这个效果

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] 100pah commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
100pah commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-609454308
 
 
   现在折线图还没有支持 brush component。
   如果想要在现在的版本中,能对折线图的“节点” 进行 brush,
   只能是,使用一个额外的 scatter series 来绘制节点,
   而 scatter series 支持了 brush component.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12336: 折线图brush设置outOfBrush,inBrush不起作用
URL: https://github.com/apache/incubator-echarts/issues/12336#issuecomment-604840788
 
 
   @yanwencheng Please provide a demo for the issue either with https://jsfiddle.net/ovilia/n6xc4df3/ or https://gallery.echartsjs.com/editor.html.

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


With regards,
Apache Git Services

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