react-vis icon indicating copy to clipboard operation
react-vis copied to clipboard

Issues with VerticalBarSeries that contains a single element

Open timtucker opened this issue 4 years ago • 0 comments

Having issues with a XYPlot with multiple VerticalBarSeries not rendering properly when one of the series has only a single data point.

#484 looked similar, but seemed to be limited to time series -- this appears to happen with any series.

This works:

      <XYPlot width={300} height={300} xDomain={[0, 5]}>
        <XAxis />
        <VerticalBarSeries
          barWidth={0.5}
          data={[
            { x: 1, y: 5 },
            { x: 2, y: 12 },
          ]}
        />
      </XYPlot>

The width of the bar with only a single data point is all wrong:

      <XYPlot width={300} height={300} xDomain={[0, 5]}>
        <XAxis />
        <VerticalBarSeries barWidth={0.5} data={[{ x: 2, y: 12 }]} />
      </XYPlot>`

Saw a few prior issues referencing similar troubles,

timtucker avatar Feb 04 '21 12:02 timtucker