-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
I am trying to invoke export with my own buttons, outside of the chart, but am getting the following error :
TypeError: AmCharts.AmExport is not a constructor
I was using an example I found on stackoverflow at http://jsfiddle.net/BGuuT/2/ which works by the way, but doesn't seem to in my own implementation for some reason. Maybe I have a newer version?
I am including in my page :
amcharts-3.21.12/amcharts.js
amcharts-3.21.12/serial.js
amcharts-3.21.12/plugins/export/export.js
html is :
<ul id="chart-selector">
<li class="dropdown-item" data-click="JPG">JPG</li>
<li class="dropdown-item" data-click="PNG">PNG</li>
<li class="dropdown-item" data-click="SVG">SVG</li>
<li class="dropdown-item" data-click="CSV">CSV</li>
<li class="dropdown-item" data-click="JSON">JSON</li>
<li class="dropdown-item" data-click="PDF">PDF</li>
<li class="dropdown-item" data-click="XLSX">XLSX</li>
<li class="dropdown-item" data-click="PRINT">Print</li>
</ul>
I am getting the correct export value to pass here, but the constructor error still shows :
chart = AmCharts.makeChart("chart_chart", { .......... });
$('body').on('click', '#chart-selector .dropdown-item', function(e) {
var test = $(this).data('click');
//chart download action
var exp = new AmCharts.AmExport(chart);
exp.init();
exp.output({
format: test
});
});
The only difference I can see between the mine and the link given is export.js compared to amexport_combined.js - the latter is not a file given in amcharts though. Ideas?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels