AntoniaQiao commented on issue #8228: 手动调用触发图表下载
URL: 
https://github.com/apache/incubator-echarts/issues/8228#issuecomment-386510907
 
 
   可以的,
   
   this.myChart = echarts.init(document.getElementById('observable-chart' + 
this.index));   // 实例化
   const url = this.myChart.getDataURL({
           pixelRatio: 2,
           backgroundColor: '#fff'
         });
   
   下载 
    downLoadChart(url) {
       const a = document.createElement('a');
       a.setAttribute('href', url);
       a.setAttribute('download', 'export');
       a.style.visibility = 'hidden';
       document.body.appendChild(a);
       a.click();
       document.body.removeChild(a);
     }

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to