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]: When bottom ticks are numbers it breaks the y axis on StackedBarChart #1760

Open
chinanwu opened this issue Feb 20, 2024 · 0 comments
Labels
type: bug 🐛 Something isn't working

Comments

@chinanwu
Copy link

Application/Team

N/A

What happened?

I'm trying to create a Bar Stacked graph with data that has the bottom tick values as numbers. For example, if you go to the StackBlitz example from the Storybook (e.g. https://charts.carbondesignsystem.com/react/?path=/story/simple-charts-bar-stacked--vertical-stacked-bar-discrete) and set the data to

export default [
  {
    group: 'Dataset 1',
    key: '1',
    value: 65000
  },
  {
    group: 'Dataset 1',
    key: '3',
    value: 29123
  }
]

you'll see that the y-axis' ticks have suddenly increased in value by a LOT. This bug can be circumvented by adding a letter to the key (i.e. '1a'). Here are some screenshots:

Screenshot 2024-02-20 at 12 19 18 PM
Screenshot 2024-02-20 at 12 19 29 PM

Version

"@carbon/charts-react": "1.14.2"

Data & options used

// data
export default [
  {
    group: 'Dataset 1',
    key: '1',
    value: 65000
  },
  {
    group: 'Dataset 1',
    key: '3',
    value: 29123
  }
]
// options (default StackBlitz)
export default {
  title: 'Vertical stacked bar (discrete)',
  axes: {
    left: {
      mapsTo: 'value',
      stacked: true
    },
    bottom: {
      mapsTo: 'key',
      scaleType: 'labels'
    }
  },
  height: '400px'
}

Relevant log output

No response

StackBlitz example

No response

What priority level would this be in your opinion?

P0

@chinanwu chinanwu changed the title [Bug]: When bottom ticks are numbers it breaks the y axis [Bug]: When bottom ticks are numbers it breaks the y axis on StackedBarChart Feb 27, 2024
@theiliad theiliad added the type: bug 🐛 Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants