dingshengqin opened a new issue #15367:
URL: https://github.com/apache/echarts/issues/15367


   ### Version
   3.5.1
   
   ### Steps to reproduce
   document.getElementById("end-time").onchange = function(){
   var myCharts3 = echarts.init(document.getElementById('main'));
   var start_time1 = document.getElementById("start-time").value;
   var end_time1 = document.getElementById("end-time").value;
   {#document.write(start-time1)#}
   {#document.write(end_time1)#}
   document.cookie="end_time=" end_time1;
   document.cookie="start_time=" start_time1;
   myCharts3.setOption({
   tooltip: {},
   toolbox: {
   left: 'center',
   itemSize: 25,
   top: 55,
   feature: {
   dataZoom: {
   yAxisIndex: 'none'
   },
   restore: {}
   }
   },
   xAxis: {
   data: []
   },
   yAxis: {},
   series: [{
   name: '平均节拍',
   type: 'bar',
   data: []
   }]
   });
   
               $.ajax({
                   url:'/get_avg_cycledata',
                   success:function (data){
                           json_data=JSON.parse(data)
                           console.info(json_data['value1'])
                           console.info(json_data['count1'])
                           console.log(json_data['value1'])
                           console.log(json_data['count1'])
   
                      myCharts3.setOption({
                                   xAxis: {
                                       data: json_data['count1']
                                   },
                                   series: [{
                                       name: '平均节拍',
                                       type: 'bar',
                                       data: json_data['value1']
                                   }]
                               });
   
                   },
                error : function(errorMsg) {
                    //请求失败时执行该函数
                    alert("图表请求数据失败!");
                }
           })
           }
           // 触发change事件的函数
           function dispatchChange(){
             var changeEvent = document.createEvent("Events");
             changeEvent.initEvent("change",true,true);
             parent.dispatchEvent(changeEvent);
           }
           dispatchChange();
   
   ### What is expected?
   when time data changed,  I want to trigger the updata of echarts.
   我想实现当input的时间数据发生变化时,触发echarts表格的更新
   
   ### What is actually happening?
   when time data changed, the ajax request is ok, data return is ok ,but 
echats has no data and no result.
   时间数据变化时console.log没问题,ajax请求没有问题,数据return也没有问题,echarts显示没有数据
   
   <!-- 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.

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