UNPKG

quoslibero

Version:

FusionCharts JavaScript charting framework

1 lines 898 B
import ExportModule from'./export';let UNDEF,isChartAPI=a=>'chartAPI'===a.getType();function exportChart(a={}){let b=this.apiInstance.getChildren('exportModule');return b=b&&b[0],b!==UNDEF&&(b.exportChart(a),!0)}function exporter(a){a.addEventListener('instantiated',function(a){let b=a.sender;isChartAPI(b)&&b.registerFactory('export',function(a){let c,d=b.getFromEnv('chartInstance');d.exportChart=exportChart,!a.getChildren('export')&&+a.getFromEnv('dataSource').chart.exportenabled&&(c=new ExportModule,a.attachChild(c,'exportModule'),c.addToEnv('chartInstance',a.getFromEnv('chartInstance')),c.addToEnv('chartMenuList',a.getFromEnv('chartMenuList')),c.configure({chartConfig:a.getFromEnv('dataSource').chart})),a.getChildren('export')&&c&&c.configure({chartConfig:a.getFromEnv('dataSource').chart})})})}export default{extension:exporter,name:'Export',type:'extension',requiresFusionCharts:!0};