showing results for - "angular export chart div excel"
Ismael
04 Jun 2017
1<body>
2    <!--Chart download link-->
3   <a id="download" style="cursor: pointer; position: absolute;right: 150px;">ExportChart</a>
4   <div id="container" ej-chart e-enablecanvasrendering="true" e-exportsettings-type="png"
5   e-exportsettings-mode="client" e-exportsettings-filename="ChartSnapshot" >
6   </div>
7   <script>
8   angular.module('syncApp', ['ejangular'])
9   .controller('Chart', function ($scope) {
10       });
11   function download() {
12    var canvas = $("#container").ejChart("export");
13    this.href = canvas.toDataURL();
14   }
15   if (document.getElementById('download').addEventListener)
16       document.getElementById('download').addEventListener('click', download, false);
17   else
18       document.getElementById('download').attachEvent('onclick', download, false);
19    </script>
20</body>