@swimlane/ngx-charts - dynamic width of line chart


Hi guys,

I’m using the ngx-charts plugin in my ionic 3 project and i’m running into issues when trying to set the dynamic width/height of the chart component. Had anyone implemented this successfuly? Documentation states to put attribute view to undefined:


It works in a plain angular plunker as expected (here):

But within ionic i get an error:

core.es5.js:1085 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined
TypeError: Cannot read property 'nativeElement' of undefined
    at LineChartComponent../src/common/base-chart.component.ts.BaseChartComponent.getContainerDims 

If i put the view = [ 400,200 ] // width, height, chart renders properly.

I’ve seen an unresolved bug report regarding this on github:

Any ideas?