Skip to content

Commit eb3c102

Browse files
authored
Merge pull request #137 from RobinKohrs/main
Fix axis titles getting cut off
2 parents a61cf01 + 61a5c7d commit eb3c102

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/marks/AxisX.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@
209209
)}
210210
x={plot.options.marginLeft +
211211
plot.plotWidth * (titleAlign === 'right' ? 1 : titleAlign === 'center' ? 0.5 : 0)}
212-
y={anchor === 'top' ? 13 : plot.height - 13}
212+
y={anchor === 'top'
213+
? (options.titleFontSize || 11) + 5
214+
: plot.height - (options.titleFontSize || 11) - 5}
213215
class="axis-x-title"
214216
dominant-baseline={anchor === 'top' ? 'auto' : 'hanging'}>{useTitle}</text>
215217
{/if}

0 commit comments

Comments
 (0)