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]: The StackedBarChart doesn't display data when the first key it receives is a string of negative number #1795

Open
irinageorge opened this issue Apr 18, 2024 · 0 comments

Comments

@irinageorge
Copy link

irinageorge commented Apr 18, 2024

Application/Team

IBM Support Insights

What happened?

Actual result: The StackedBarChart doesn't display data when the first key it receives is a string of negative number, e.g. key: "-6".
Screenshot 1

The chart works okay when:

  • the first key is NOT a string of negative number, e.g. key: "-6";
  • the first key is a string of negative number + text, e.g. key: "-6M";
  • the first key is "-Some Key".

Expectations: The chart to display data when the first key that it receives is a string of negative number, e.g. key: "-6".

Version

"@carbon/charts-react": "^1.15.5"

Data & options used

//data
export default [
  {
    group: 'Dataset 1',
    key: '-6',
    value: 65000
  },
  {
    group: 'Dataset 2',
    key: '0',
    value: 29123
  },
  {
    group: 'Dataset 3',
    key: '6',
    value: 35213
  }
]

//options
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?

P2

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

1 participant