question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot read property 'getColor' of undefined - Stacked Area Chart

See original GitHub issue

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

I’m trying to display a Stacked Area Chart

<ngx-charts-bar-horizontal-stacked
   [view]="[400, 300]"
   [results]="results"
   [xAxis]="true"
   [yAxis]="true"
   [legend]="true"
   [legendPosition]="'below'"
   [scheme]="colorScheme"
   [xAxisLabel]="'Date'"
   [yAxisLabel]="'Number'"
   [showXAxisLabel]="true"
   [showYAxisLabel]="true">
</ngx-charts-bar-horizontal-stacked>

Current behavior

In browser logs:

ERROR TypeError: Cannot read property 'getColor' of undefined
    at Object.eval [as updateDirectives] (AreaSeriesComponent.html:6)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:39364)
    at checkAndUpdateView (core.js:38376)
    at callViewAction (core.js:38742)
    at execComponentViewsAction (core.js:38670)
    at checkAndUpdateView (core.js:38383)
    at callViewAction (core.js:38742)
    at execEmbeddedViewsAction (core.js:38699)
    at checkAndUpdateView (core.js:38377)
    at callViewAction (core.js:38742)

Expected behavior

Display the Stacked Area Chart in browser.

Please tell us about your environment:

  • macOS Mojave: version 10.14.6
  • Google Chrome: version 77.0.3865.90 (Official Build) (64-bit)
  • @swimlane/ngx-charts: ^12.0.1
  • Angular: 8.1.3

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
Airbladercommented, Oct 28, 2019

We’re seeing this as well using ngx-charts-line-chart and ngx-charts in version 11.2.0. The issue only appears in a production build, not in a dev build.

2reactions
Airbladercommented, Oct 28, 2019

I believe this may be related to #1288. It appears the downgrade mentioned there fixes our issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngx-charts-line-chart failing with Cannot read property ...
I'm setting up a simple example of the line chart and it fails with the getColor on undefined error. If I remove the...
Read more >
Developers - Error: Cannot read property 'getColor' of undefined
Error : Cannot read property 'getColor' of undefined - Stacked Area Chart.
Read more >
swimlane/ngx-charts - Gitter
... use a ngx-charts-line-chart and I am getting loads of errors in the console of this type. ERROR TypeError: Cannot read property 'getColor'...
Read more >
Stack | Vega-Lite
null or false - No-stacking. This will produce layered bar and area chart. Default value: zero for plots with all of the following...
Read more >
Uncaught TypeError: Cannot read property '_controlCorners'
Learned: console.log everything! Console.log of map variable revealed it was undefined. Needed to move control code down below where I ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found