-
Is it possible to explicitly set the height of the bars in a BarX mark, rather than having them auto-compute their height based on the height of the whole Plot and the number of bars? I don't mean different bar sizes in the same Plot but one height value to apply to all bars. I am displaying multiple plots on one screen and they have different numbers of bars and I want the bars to be consistent sizes across plots, so I am omitting the height attribute, but I also don't want the bars to be the built-in/default height (which seems to be 18px). I can't seem to figure out how to override this 18 pixel value, or find where it is defined. <g aria-label="bar">
<rect x="200" width="3.4606299212598515" y="26" height="18" fill="#4269d0"></rect>
<rect x="200" width="3.4606299212598515" y="366" height="18" fill="#4269d0"></rect>
.... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
It seems at some point a Band scale is created which contains the values used when rendering the bars, but so far I've been unable to figure out how to pass in my own D3 band scale object (where, and with what values?) ... |
Beta Was this translation helpful? Give feedback.
The default bar height of 18 comes from the 20 here (accounting for the padding between bars):
plot/src/dimensions.js
Line 119 in 14d6e43
The default bar height is not configurable; you can only set the overall height of the chart.