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

[Bug]: VerticalBarChart not rendering with only 0 values #33693

Open
2 tasks done
poz1 opened this issue Jan 21, 2025 · 0 comments
Open
2 tasks done

[Bug]: VerticalBarChart not rendering with only 0 values #33693

poz1 opened this issue Jan 21, 2025 · 0 comments

Comments

@poz1
Copy link

poz1 commented Jan 21, 2025

Charting Control

VerticalBarChart

Package version

@fluentui/react-charts-preview 0.1.6

React version

17.0.2

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (22) x64 Intel(R) Core(TM) Ultra 7 165H
    Memory: 8.63 GB / 31.64 GB
  Browsers:
    Edge: Chromium (131.0.2903.146)
  npmPackages:
    react: ^17.0.2 => 17.0.2
    react-dom: ^17.0.2 => 17.0.2

Current Behavior

Chart works great when at least one data point is greater than 0. If all data points are equal to 0 it is not rendered.

Image

A mitigation is to set an empty line in one of the data points

const points: VerticalBarChartDataPoint[] = [
   {
     x: 0,
     y: 0,
   },
   {
     x: 10000,
     y: 0,
    lineData: {
        y: 0
      },
   },
 ];

Expected Behavior

0 should be treated as a valid value, what we were expecting was to see the 'empty table'

Image

Reproduction

https://stackblitz.com/edit/wqcgjysf?file=src%2Fexample.tsx

Steps to reproduce

create a VerticalBarChart and use these datapoints:

 const points: VerticalBarChartDataPoint[] = [
    {
      x: 0,
      y: 0,
    },
    {
      x: 10000,
      y: 0,
      // lineData: {
      //   y: 0
      // },
    },
  ];

Are you reporting an Accessibility issue?

None

Suggested severity

Medium - Has workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants