1
votes

I have a stack barchart and added an outline to the bars via

.dc-chart rect.bar {stroke: black;}

I have also defined

.elasticY(true)

The black outline at the top of the bar (xAxis 0) is chopped by a pixel compared to the top of the bar (xAxis 2). Is there anyway to pad the y max range by a little so I can see the outline and still keep elasticY?

enter image description here

1

1 Answers

2
votes

Strangely enough, it's called yAxisPadding, and it's documented here. It does work with elasticY.

I guess the Markdown documentation is getting a little long to just browse. The HTML documentation is better if you know the particular class or mixin where the function might be defined. (Takes some practice.)

You can use either a number, in domain units:

chart.yAxisPadding(10)

or a percentage, as a string:

chart.yAxisPadding("5%")

Padding in domain units can lead to some surprises, though.