-
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 |
Beta Was this translation helpful? Give feedback.
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
] |
Beta Was this translation helpful? Give feedback.
-
@gampleman thanks. It's so obvious. Any advice for the scale with ticks all under the chart? |
Beta Was this translation helpful? Give feedback.
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: