Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c04e16ea authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

5422 - fix first graduation label on big screens.

parent 5aa1f270
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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<Pair<Int, Int>>()
@@ -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) ?: ""
                }
            }
        }