carbon-charts icon indicating copy to clipboard operation
carbon-charts copied to clipboard

[Bug]: Cannot use zoom bar with ScatterChart and a single data point

Open a88zach opened this issue 1 year ago • 2 comments
trafficstars

Relevant package(s)

  • [ ] @carbon/charts
  • [ ] @carbon/charts-svelte
  • [X] @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 avatar Aug 06 '24 21:08 a88zach