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:
<ngx-charts-line-chart
[view]="undefined"
[scheme]="colorScheme"
[results]="multi"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[showXAxisLabel]="false"
[showYAxisLabel]="false"
[xAxisLabel]="xAxisLabel"
[yAxisLabel]="yAxisLabel"
[autoScale]="autoScale"
(select)="onSelect($event)">
</ngx-charts-line-chart>
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?