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

Add alignment prop for VictoryBar #764

Closed
corradio opened this issue Sep 26, 2017 · 3 comments · Fixed by FormidableLabs/victory-chart#519
Closed

Add alignment prop for VictoryBar #764

corradio opened this issue Sep 26, 2017 · 3 comments · Fixed by FormidableLabs/victory-chart#519
Assignees
Labels
Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release

Comments

@corradio
Copy link

Hi,

First of all, thanks for the great work here.
Looking at https://formidable.com/open-source/victory/docs/victory-bar, I could not find a way to position the bars such that they start and end at the ticks, instead of being centred around the ticks.
Any way to do this?

Best workaround I've found is to use a VictoryLine using stepAfter, but this prohibits setting a colour by bar, as the colour affects the whole path.

Best,

Olivier

@boygirl
Copy link
Contributor

boygirl commented Sep 26, 2017

@corradio @djMax currently you can add a transform to either your bar primitive or your group component.
I'm also considering adding an alignment prop for VictoryBar since this feature has seen reasonable demand. I've resisted this idea for a long time since it has the potential to create inaccurate charts.

@boygirl boygirl changed the title VictoryBar position Add alignment prop for VictoryBar Sep 26, 2017
@boygirl boygirl self-assigned this Sep 26, 2017
@boygirl boygirl added the Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release label Sep 26, 2017
@boygirl
Copy link
Contributor

boygirl commented Sep 26, 2017

Proposal:

Add alignment prop to VictoryBar and Bar primitive. Allowed values for this prop will be "start", "middle" (default) and "end". This prop would be taken into account when calculating the path. No transformations will be required.

@jmjpro
Copy link

jmjpro commented Oct 19, 2017

I think we also need to add the alignment prop to the VictoryBarProps typescript interface:

{
  ...
  alignment: 'start' | 'middle' | 'end';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants