Ngx-charts: ERROR TypeError: Cannot read property 'map' of undefined at BarVerticalComponent../src/bar-chart/bar-vertical.component.ts.BarVerticalComponent.getXDomain

Created on 29 May 2017  路  3Comments  路  Source: swimlane/ngx-charts

I'm submitting a ... (check one with "x")

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior
Load data from angular service with http.get and retrieve them on constructor method
Graphics are displayed ok but console shows these logs of errors. Also it breaks angular routes.

Expected behavior
Should skip this error and stay on same route url.

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • ngx-charts version: x.x.x

  • Angular version: 2.x.x

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Most helpful comment

This happens when the data (in their examples called single and multi) you bind to the chart is undefined (at least it did for us). Just initialize your data with an empty array and see if it still happens.

All 3 comments

Could you provide a small reproduction of this problem?

This happens when the data (in their examples called single and multi) you bind to the chart is undefined (at least it did for us). Just initialize your data with an empty array and see if it still happens.

I still think ngx-charts should provide a better error message when one of the input is undefined

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sjdemoor picture sjdemoor  路  3Comments

NashIlli picture NashIlli  路  3Comments

Jacquers picture Jacquers  路  3Comments

DZDomi picture DZDomi  路  4Comments

amcdnl picture amcdnl  路  4Comments