You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/04/29 15:03:41 UTC

[GitHub] [incubator-echarts] Kafty opened a new issue #10381: datazoom does not return start and end values

Kafty opened a new issue #10381: datazoom does not return start and end values
URL: https://github.com/apache/incubator-echarts/issues/10381
 
 
   ### Version
   4.1.0-release
   
   ### Reproduction link
   [https://ecomfe.github.io/echarts-examples/public/editor.html?c=doc-example/getting-started](https://ecomfe.github.io/echarts-examples/public/editor.html?c=doc-example/getting-started)
   
   ### Steps to reproduce
   Please copy this into input on the left side.
   
   // please copy this :)
   
   option = {
       title: {
           text: 'ECharts 入门示例'
       },
       tooltip: {},
       legend: {
           data:['销量']
       },
       xAxis: {
           data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
       },
       yAxis: {},
       series: [{
           name: '销量',
           type: 'bar',
           data: [5, 20, 36, 10, 10, 20]
       }],
       toolbox: {
           feature: {
               restore: {
                   title: 'Restore',
               },
               dataZoom: {
                   title: {
                       zoom: 'Zoom',
                       back: 'Back',
                       clear: 'Back',
                   },
                   restore: {
                       title: 'Restore',
                   },
               },
           },
       },
       dataZoom: [
           {
               type: 'inside',
               show: true,
               zoomOnMouseWheel: false,
               moveOnMouseMove: false,
           },    
       ]
   };
   
   myChart.on('dataZoom', function (params) {
       console.log(params);
       
       // should return percentage values, but returns undefined
       console.log(params.batch[0].start);
       console.log(params.batch[0].end);
   });
   
   myChart.on('dataZoom', function (params) {
       console.log(params);
       
       // should return percentage values, but returns undefined
       console.log(params.batch[0].start);
       console.log(params.batch[0].end);
   });
   
   then try to zoom graph, and then have a look into console
   
   ### What is expected?
   I thought, the dataZoom event (triggered after zooming the graph using the toolbox buttons) would return start and end values in percent
   
   ### What is actually happening?
   start and end (percents) returns undefined. Values are not included in the payload of an event.
   
   ---
   Thank you :)
   
   <!-- 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


With regards,
Apache Git Services

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