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]: Cannot use zoom bar with ScatterChart and a single data point #1877

Open
1 of 6 tasks
a88zach opened this issue Aug 6, 2024 · 2 comments
Open
1 of 6 tasks

Comments

@a88zach
Copy link
Contributor

a88zach commented Aug 6, 2024

Relevant package(s)

  • @carbon/charts
  • @carbon/charts-svelte
  • @carbon/charts-react
  • @carbon/charts-angular
  • @carbon/charts-vue
  • Documentation website

Carbon Charts Version

1.19.2

Which bundler are you using?

Vite

What happened and what did you expect to happen?

When rendering a scatter chart with the zoom bar enabled and a single data point, the data point is not shown on the chart.

The scatter chart displays correctly when there are more than 1 data point.

Chart data and options (automatically formatted so no need for backticks)

data = {
  group: 'Dataset 1',
  date: '2023-01-01',
  value: 50000
};

options = {
  title: 'Scatter (time series)',
  axes: {
    bottom: {
      title: '2019 Annual Sales Figures',
      scaleType: 'time',
      mapsTo: 'date'
    },
    left: {
      mapsTo: 'value'
    }
  },
  zoomBar: {
    top: {
      enabled: true,
    },
  },
  height: '400px'
}

JavaScript console or build output (if relevant)

No response

StackBlitz repro

https://stackblitz.com/edit/react-by6srr?file=src%2Findex.js

IBM Application/Team (if relevant)

No response

What priority level would this be in your opinion?

P2 (Medium)

@a88zach a88zach changed the title [Bug]: Cannot use zoom bar with ScatterChart with a single data point [Bug]: Cannot use zoom bar with ScatterChart and a single data point Aug 6, 2024
@a88zach
Copy link
Contributor Author

a88zach commented Aug 6, 2024

To reproduce, just load the Stackblitz. You can see it working correctly by doing 1 of 2 things

  1. comment out the zoomBar option
  2. add a 2nd data point

@SwarnalathaMunukutla
Copy link

hi would like to contribute to this

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