swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Error: this.groupScale is not a function - BarVertical2DComponent #1276

Open ImanCocquyt opened 4 years ago

ImanCocquyt commented 4 years ago

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 grouped vertical bar chart

<ngx-charts-bar-vertical-2d
   [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-vertical-2d>

Current behavior

In browser logs:

BarVertical2DComponent.html:50 ERROR TypeError: this.groupScale is not a function
    at BarVertical2DComponent.push.../../node_modules/@swimlane/ngx-charts/release/esm.js.BarVertical2DComponent.groupTransform (esm.js:7935)
    at Object.eval [as updateRenderer] (BarVertical2DComponent.html:54)
    at Object.debugUpdateRenderer [as updateRenderer] (core.js:39399)
    at checkAndUpdateView (core.js:38382)
    at callViewAction (core.js:38742)
    at execEmbeddedViewsAction (core.js:38699)
    at checkAndUpdateView (core.js:38377)
    at callViewAction (core.js:38742)
    at execComponentViewsAction (core.js:38670)
    at checkAndUpdateView (core.js:38383)

Expected behavior

Display the grouped vertical bar chart in browser.

Please tell us about your environment:

ImanCocquyt commented 4 years ago

Same error with Grouped Horizontal Bar Chart:

HTML:

<ngx-charts-bar-horizontal-2d
   [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-2d>

Error:

ERROR TypeError: this.groupScale is not a function
    at BarHorizontal2DComponent.push.../../node_modules/@swimlane/ngx-charts/release/esm.js.BarHorizontal2DComponent.groupTransform (esm.js:6524)
    at Object.eval [as updateRenderer] (BarHorizontal2DComponent.html:53)
    at Object.debugUpdateRenderer [as updateRenderer] (core.js:39399)
    at checkAndUpdateView (core.js:38382)
    at callViewAction (core.js:38742)
    at execEmbeddedViewsAction (core.js:38699)
    at checkAndUpdateView (core.js:38377)
    at callViewAction (core.js:38742)
    at execComponentViewsAction (core.js:38670)
    at checkAndUpdateView (core.js:38383)
pantonis commented 4 years ago

@ImanCocquyt did you find a solution to it?

jrquick17 commented 4 years ago

This error showed for me when I was passing invalid results. I would double check that.

pantonis commented 4 years ago

@thanks for your interest but I dropped ngx-charts. Full of bugs and as far as I can see hundreds of unresolved issues. Not reliable at all for production.