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

Logged error when graph data values consists of all 0's #41

Open
jojobobby opened this issue May 25, 2023 · 1 comment
Open

Logged error when graph data values consists of all 0's #41

jojobobby opened this issue May 25, 2023 · 1 comment

Comments

@jojobobby
Copy link

jojobobby commented May 25, 2023

Issue

Having an issue with your funnel graph library where I can have default values as 0, but it logs errors to my console when I draw the graph with those values.

Explanation

The actual functionality of the graph is fine, it displays with no data as it should and shows 0 as all values.
The issue is that it also sends a error for NaN as I suspect that it is trying to draw the graph with no data to work with instead of ignoring the draw entirely.

This quickly becomes bloat in my error-logs when debugging, especially when i'm updating the graph on a timed interval of 5 seconds.

Images

Code:
Screenshot 2023-05-25 at 11 58 07 AM

Error:
Screenshot 2023-05-25 at 11 58 48 AM

Example

Example on how to replicate this issue: (The values are the only important part)
-> The code was meant to serve as a example, may not be runnable

const graph = new FunnelGraph({
  container: ".funnel",
  gradientDirection: "horizontal",
  data: {
    labels: ["X", "Y", "Z"],
    colors: ["#000000", "#000000"],
    values: [0, 0, 0]
  },
  displayPercent: true,
  direction: "horizontal",
  width: 1000,
  height: 100,
  subLabelValue: "raw"
})
  
graph.draw();
@cnicodeme
Copy link

Did you solve it or found a solution ? I have the same issue.

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

No branches or pull requests

2 participants