YagoLopez / ng-dashboard

:bar_chart: Dashboard for Angular (versions 4 +)
MIT License
59 stars 11 forks source link

Error when resizing window #4

Open cabrinoob opened 5 years ago

cabrinoob commented 5 years ago

Hi, I'am trying to use you angular component fot metrics-graphics lib, and everything works fine except the following lines :

@HostListener('window:resize') onWindowsResize() {
    this.isLoading = true;
    setTimeout( () => {
      this.config.width = this.chartContainer.nativeElement.clientWidth;
      this.drawMGChart(this.config);
    }, 0)
  }

So, when I resize the window, drawMGChart is called again and pops this error :

ERROR TypeError: existing_line.transition is not a function
    at mg_add_line (metricsgraphics.js:4422)
    at mg_draw_all_line_elements (metricsgraphics.js:4821)
    at mg_line_main_plot (metricsgraphics.js:4855)
    at lineChart.mainPlot (metricsgraphics.js:5043)
    at lineChart.init (metricsgraphics.js:5033)
    at new lineChart (metricsgraphics.js:5146)
    at Object.MG.data_graphic (metricsgraphics.js:833)
    at mgChartCmp.ts:58
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)

FYI, I'am using metrics-graphics v2.15.6 (and angular 7.2.0)

thank you

YagoLopez commented 5 years ago

Probably the error has to do with with the use of new versions. I can only warranty my code is working in the versions it was developed and I have no time right now to mantain the project. If you want you can search the error by Google and I can give you permission to help to maintain the code. Probably this is related to a new version of Angular.