fix: BarChart text overflowing (#35)

This commit is contained in:
Florian Bouillon 2023-01-15 13:51:55 +01:00 committed by GitHub
parent 30454becad
commit 73d2d21a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,6 +147,15 @@ class BarSerie(
textY = drawableSpace.top + rect.height() textY = drawableSpace.top + rect.height()
} }
if (
// check text not overflowing on left side
textX + barWidth / 2 > right ||
// check text not overflowing on right side
textX + barWidth / 2 > drawableSpace.right
) {
continue
}
canvas.drawText( canvas.drawText(
text, text,
textX, textX,