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

VictoryBar displays thin bar if only a single data point is present #1054

Closed
4 tasks done
ProtenusBill opened this issue Jul 19, 2018 · 4 comments · Fixed by #1061
Closed
4 tasks done

VictoryBar displays thin bar if only a single data point is present #1054

ProtenusBill opened this issue Jul 19, 2018 · 4 comments · Fixed by #1061
Labels
Note: Good first issue 🤩 Good issue for new contributors Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@ProtenusBill
Copy link

Bugs and Questions

Checklist

  • This is not a victory-native specific issue. (Issues that only appear in victory-native should be opened here)

  • I have read through the FAQ and Guides before asking a question

  • I am using the latest version of Victory

  • I've searched open issues to make sure I'm not opening a duplicate issue

The Problem

As additional bars appear in the chart, Victory intelligently reduces the width of the bars to fit everything into the chart. However, if only one bar is present said bar is unexpectedly very thin and can't be modified via the barRatio property.

Ideally the bar should default to an appropriate width (just as two bars are thicker than three bars) and/or it should be manipulable via barRatio.

Reproduction

This can be reproduced by modifying one of the interactive demos found in the documentation:

Single thin bar (barRatio on VictoryBar has no effect)

<VictoryChart theme={VictoryTheme.material}>
  <VictoryBar data={[{x: 'thin bar', y: 5}]} />
</VictoryChart>

Two bars are thicker and can be controlled via barRatio

<VictoryChart theme={VictoryTheme.material}>
  <VictoryBar data={[{x: 'much', y: 5}, {x: 'better', y: 5}]} />
</VictoryChart>
@boygirl
Copy link
Contributor

boygirl commented Jul 21, 2018

@ProtenusBill Thank you for this issue. This is definitely a bug on our end. As a temporary work around, you can set a width in your bar styles when there is only a single bar.

@boygirl boygirl added Type: Bug 🐛 Oh no! A bug or unintentional behavior Note: Good first issue 🤩 Good issue for new contributors labels Jul 21, 2018
@40x
Copy link

40x commented Jul 25, 2018

PR en-route

@vincentdesmares
Copy link

I still have the issue with victory@31.0.1.

@abeledovictor
Copy link

Still having the issue with victory@34.3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Note: Good first issue 🤩 Good issue for new contributors Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants