diff --git a/app/src/main/java/foundation/e/privacycentralapp/common/GraphHolder.kt b/app/src/main/java/foundation/e/privacycentralapp/common/GraphHolder.kt index 51064d2cbe09abdd52761c301b6777baf168c434..a25b68e784a58cbe64d41f8d78d58568d06ea6f1 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/common/GraphHolder.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/common/GraphHolder.kt @@ -45,6 +45,7 @@ import com.github.mikephil.charting.renderer.XAxisRenderer import com.github.mikephil.charting.utils.MPPointF import foundation.e.privacycentralapp.R import foundation.e.privacycentralapp.common.extensions.dpToPxF +import kotlin.math.floor class GraphHolder(val barChart: BarChart, val context: Context, val isMarkerAbove: Boolean = true) { var data = emptyList>() @@ -176,7 +177,7 @@ class GraphHolder(val barChart: BarChart, val context: Context, val isMarkerAbov textColor = context.getColor(R.color.primary_text) valueFormatter = object : ValueFormatter() { override fun getAxisLabel(value: Float, axis: AxisBase?): String { - return graduations?.getOrNull(value.toInt() + 1) ?: "" + return graduations?.getOrNull(floor(value).toInt() + 1) ?: "" } } }