Repository navigation
|
already succeed with the sample to change the axis orientation but try to change the width or height of the graph and stuff goes wrong the height of the graph should be variable to the number of series to keep the width of one value Thanks for help |
Answered by
gampleman
Oct 27, 2021
Replies: 2 comments 3 replies
|
You're using a BandScale which is designed to do the opposite: to keep the overall space constant and divide the space equally between bands (with optional padding and spacing). If you don't want that behavior, than the alternative is to not use a scale at all, just pick a width and use multiplication, i.e. something like this: barHeight = 40
view bars =
svg [ viewBox 0 0 w (barHeight * List.length bars + somePadding) ]
[ ...
, List.indexedMap (\index bar -> rect [ y (index * barHeight), ...] ) bars
] |
0 replies
Answer selected by
gampleman
|
@gampleman thanks. It's so obvious. Any advice for the scale with ticks all under the chart? |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

You're using a BandScale which is designed to do the opposite: to keep the overall space constant and divide the space equally between bands (with optional padding and spacing).
If you don't want that behavior, than the alternative is to not use a scale at all, just pick a width and use multiplication, i.e. something like this: