Skip to content

Setting the height of each bar in a BarX mark, as opposed to the height of the whole Plot #2281

Answered by mbostock
sbarre asked this question in Q&A
Discussion options

You must be logged in to vote

The default bar height of 18 comes from the 20 here (accounting for the padding between bars):

return !!(y || fy) * Math.max(1, Math.min(60, ny * nfy)) * 20 + !!fx * 30 + 60;

The default bar height is not configurable; you can only set the overall height of the chart.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@sbarre
Comment options

@Fil
Comment options

Fil Feb 10, 2025
Collaborator

@sbarre
Comment options

@mbostock
Comment options

Answer selected by sbarre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants