Automatic bar widths, padding and offset within a group inside a custom chart. #2105
Replies: 3 comments
-
I also have the same problem with VictoryGroup offset and bar width, currently what I'm doing is limiting the data set and calculate the bar width accordingly but it is not a proper solution in my use case. if this feature can be added to the library it would be really useful. |
Beta Was this translation helpful? Give feedback.
-
This is a recurring issue I'm running into as well. Is there guidance one way or the other? |
Beta Was this translation helpful? Give feedback.
-
A few issues have come up around bar widths and spacing, and I don't know if there's a straightforward solution that works in every case. I'm going to convert this to a discussion thread so we can talk about options for improving bar chart spacing and alignment. |
Beta Was this translation helpful? Give feedback.
-
So I've been using Victory pretty successfully, but I primarily use custom charts which seem to have a few downsides I've noticed and I was wondering if you had any thoughts on how to fix those issues.
You can see a rough example of what I'm doing with my dual axis chart (for some reason the bottom axis isn't working, but It's working locally so I'm not sure what's going on with that).
Anyway, the biggest issue I've run into is that the number of
VictoryGroup
andVictoryBar
components I have is dynamic. However, offsets, padding, and bar widths don't seem to be automatically set at all, so I'm having the hardest time lining the groups and bar widths up with not only the labels on thex
axis, but with each other. Essentially what I've ended up with is a giant case statement to use different values in the different situations, but I was hoping there was a better way to do this automatically (or at least less manually). Do you have any suggestions for this?The next biggest issue is dynamic resizing of the chart area. What I would like, is for the actual aspect ratio of the chart to change upon resizing. I'd like heigh to be fixed, but the width to be dynamic upon the container size. I was trying to avoid passing a size into the graph as a prop or something, but as far as I can see for custom charts this is the only way. Is there a better one you know of?
Either way, I've been pretty happy with Victory so thanks for all your hard work!
Beta Was this translation helpful? Give feedback.
All reactions