import {customElement, bindable, inject} from 'aurelia-framework';
import {WidgetBase} from '../common/widget-base';
import {generateBindables} from '../common/decorators';
import {PDF} from '../pdf/pdf'; //eslint-disable-line no-unused-vars
import 'kendo-ui/js/kendo.dataviz.chart.min';
import 'kendo-ui/js/kendo.dataviz.chart.polar.min';
import 'kendo-ui/js/kendo.dataviz.chart.funnel.min';

@customElement('k-chart')
@generateBindables('kendoChart')
@inject(Element)
export class Chart extends WidgetBase {

  @bindable kDataSource;
  @bindable options = {};

  constructor(element) {
    super('kendoChart', element);
  }

  attached() {
    this._initialize();
  }

  exportImage(options) {
    if (this.widget) {
      return this.widget.exportImage(options);
    }
  }

  exportPDF(options) {
    if (this.widget) {
      return this.widget.exportPDF(options);
    }
  }

  exportSVG(options) {
    if (this.widget) {
      return this.widget.exportSVG(options);
    }
  }

  getAxis(name) {
    if (this.widget) {
      return this.widget.getAxis(name);
    }
  }

  redraw() {
    if (this.widget) {
      return this.widget.redraw();
    }
  }

  refresh() {
    if (this.widget) {
      return this.widget.refresh();
    }
  }

  resize() {
    if (this.widget) {
      return this.widget.resize();
    }
  }

  saveAsPDF() {
    if (this.widget) {
      return this.widget.saveAsPDF();
    }
  }

  setDataSource(dataSource) {
    if (this.widget) {
      return this.widget.setDataSource(dataSource);
    }
  }

  setOptions(value) {
    if (this.widget) {
      return this.widget.setOptions(value);
    }
  }

  svg() {
    if (this.widget) {
      return this.widget.svg();
    }
  }

  imageDataURL() {
    if (this.widget) {
      return this.widget.imageDataURL();
    }
  }

  toggleHighlight(show, options) {
    if (this.widget) {
      return this.widget.toggleHighlight(show, options);
    }
  }

  destroy() {
    if (this.widget) {
      return this.widget.destroy();
    }
  }
}

@@ -166,16 +166,18 @@
 ators';%0A
+//
 import %7B
@@ -279,24 +279,26 @@
 chart.min';%0A
+//
 import 'kend
@@ -337,16 +337,18 @@
 r.min';%0A
+//
 import '
@@ -667,24 +667,27 @@
 ze();%0A  %7D%0A%0A 
+ //
  exportImage
@@ -691,32 +691,35 @@
 age(options) %7B%0A 
+ //
    if (this.widg
@@ -717,32 +717,35 @@
 this.widget) %7B%0A 
+ //
      return this
@@ -771,35 +771,44 @@
 (options);%0A 
+ //
    %7D%0A 
+ //
  %7D%0A%0A 
+ //
  exportPDF(o
@@ -810,32 +810,35 @@
 PDF(options) %7B%0A 
+ //
    if (this.widg
@@ -837,36 +837,39 @@
 his.widget) %7B%0A  
+//
     
+ 
 return this.widg
@@ -892,27 +892,36 @@
 ions);%0A 
+ //
    %7D%0A 
+ //
  %7D%0A%0A 
+ //
  exportS
@@ -927,32 +927,35 @@
 SVG(options) %7B%0A 
+ //
    if (this.widg
@@ -953,32 +953,35 @@
 this.widget) %7B%0A 
+ //
      return this
@@ -1005,30 +1005,36 @@
 (options);%0A 
+ //
    %7D%0A 
+ //
  %7D%0A%0A  getAxi
@@ -1366,16 +1366,19 @@
 %7D%0A  %7D%0A%0A 
+ //
  saveAsP
@@ -1381,24 +1381,27 @@
 eAsPDF() %7B%0A 
+ //
    if (this.
@@ -1404,36 +1404,39 @@
 his.widget) %7B%0A  
+//
     
+ 
 return this.widg
@@ -1448,30 +1448,36 @@
 veAsPDF();%0A 
+ //
    %7D%0A 
+ //
  %7D%0A%0A  setDat
@@ -1685,16 +1685,19 @@
 %7D%0A  %7D%0A%0A 
+ //
  svg() %7B
@@ -1694,24 +1694,27 @@
 // svg() %7B%0A 
+ //
    if (this.
@@ -1717,36 +1717,39 @@
 his.widget) %7B%0A  
+//
     
+ 
 return this.widg
@@ -1755,30 +1755,36 @@
 get.svg();%0A 
+ //
    %7D%0A 
+ //
  %7D%0A%0A  imageD

remove unused functions