mirror of
https://github.com/dzeiocom/charts.git
synced 2025-04-22 18:52:08 +00:00
fix: YAxis offset not correct
This commit is contained in:
parent
732aa65c19
commit
4c9b4bd2a6
@ -100,9 +100,9 @@ class YAxis(
|
|||||||
var maxWidth = 0f
|
var maxWidth = 0f
|
||||||
|
|
||||||
val increment = (bottom - top) / labelCount
|
val increment = (bottom - top) / labelCount
|
||||||
val valueIncrement = (max - min) / labelCount
|
val valueIncrement = max / labelCount
|
||||||
for (index in 0 until labelCount) {
|
for (index in 0 until labelCount) {
|
||||||
val text = onValueFormat((valueIncrement * (index + 1)))
|
val text = onValueFormat(min + (valueIncrement * (index + 1)))
|
||||||
textLabel.getTextBounds(text, 0, text.length, rect)
|
textLabel.getTextBounds(text, 0, text.length, rect)
|
||||||
maxWidth = maxWidth.coerceAtLeast(rect.width().toFloat())
|
maxWidth = maxWidth.coerceAtLeast(rect.width().toFloat())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user