Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gauge and donut charts don't render empty label text in v2.2.6 #3066

Closed
lrdiv opened this issue Jan 29, 2023 · 2 comments
Closed

Gauge and donut charts don't render empty label text in v2.2.6 #3066

lrdiv opened this issue Jan 29, 2023 · 2 comments

Comments

@lrdiv
Copy link

lrdiv commented Jan 29, 2023

Description

I'm on d3 version 5.0.0 attempting to migrate from c3.js to billboard.js

Most charts looks great after following the migration instructions linked in the README. However, both donut and gauge chart types are having different issues displaying the empty label text.

Gauge: When an empty array is passed as data.columns, an exception is thrown that says Reduce of empty array with no initial value which seems to be caused by trying to calculate the gauge chart's max value on an empty dataset.

Donut: When an empty array is passed as data.columns, no text is rendered.

Are there any known workarounds for this?

Steps to check or reproduce

I've reproduced both of these with the most basic implementation possible on Stackblitz: https://stackblitz.com/edit/typescript-kwgtun?file=index.ts

Edit: to see the issue with donut charts in the above Stackblitz, the gauge chart code must be commented out first

@netil netil added the question label Jan 30, 2023
netil pushed a commit to netil/billboard.js that referenced this issue Feb 1, 2023
Make background arc to not draw when has no data to show

Ref naver#3066
@netil netil added the bug label Feb 1, 2023
netil added a commit that referenced this issue Feb 1, 2023
Make background arc to not draw when has no data to show

Ref #3066
@netil
Copy link
Member

netil commented Feb 1, 2023

Hi @lrdiv, thanks for the report.
It was a bug regardless the version and I'll be looking how to fix for 2.x

github-actions bot pushed a commit that referenced this issue Feb 6, 2023
## [3.7.4](3.7.3...3.7.4) (2023-02-06)

### Bug Fixes

* **gauge:** fix when has no data ([efe7435](efe7435)), closes [#3066](#3066)
* **react:** Fix props argument handlling ([fb38d30](fb38d30)), closes [#3075](#3075)
* **type:** fix to export option type definition ([e4f3a2f](e4f3a2f)), closes [#3077](#3077)
@netil
Copy link
Member

netil commented Feb 6, 2023

@lrdiv, released  v2.2.7 as the patch version.
Try by installing,

$ npm install billboard.js@2.2.7

@netil netil closed this as completed Feb 6, 2023
lrdiv pushed a commit to lrdiv/billboard.js that referenced this issue Mar 15, 2023
Make background arc to not draw when has no data to show

Ref naver#3066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants