title: How export echarts to excel?
body: <p>Im trying to export a graph echarts to excel, right now i can export it to png but i dont find the way to make it to excel, i will put part of my code so maybe anyone have an idea:</p>
  
  <p>API: <a href="https://echarts.apache.org/en/api.html#echarts" rel="nofollow noreferrer">https://echarts.apache.org/en/api.html#echarts</a></p>
  
  <p>I tried printing the data of the array but no way</p>
  
  <pre><code>saveAsImageChart(chart) {
      const url = chart.getConnectedDataURL({
        pixelRatio: 2,
        type: 'png',
        name: this.pregunta.cod + '.png',
        backgroundColor: '#fff',
        excludeComponents: ['toolbox'],
      });
  
      const deviceInfo = this.deviceService.getDeviceInfo();
  
      const $a = document.createElement('a');
      $a.download = this.pregunta.cod + '.png';
      $a.target = '_blank';
      $a.href = url;
      // Chrome and Firefox
      if (deviceInfo.browser !== 'ie') 
      {
        const evt = new MouseEvent('click', {
          view: window,
          bubbles: true,
          cancelable: false
        });
        $a.dispatchEvent(evt);
      } 
  
      else 
      {
        const html = '&lt;body style="margin:0;"&gt;' +
                       '&lt;img src="' + url + '" style="max-width:100%;" title="chart.png" /&gt;' +
                     '&lt;/body&gt;';
        const tab = window.open();
        tab.document.write(html);
      }
    }
  </code></pre>