From 10bbe8e30c147283af2c0e711e6c83b26211216d Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Thu, 29 Feb 2024 15:20:45 +0300 Subject: [PATCH] Set minimum and maximum values for the left axis of the traffic chart --- .../lists/sections/traffic/TrafficBarChartViewHolder.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/traffic/TrafficBarChartViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/traffic/TrafficBarChartViewHolder.kt index 11df4b0219ce..a26a79885223 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/traffic/TrafficBarChartViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/traffic/TrafficBarChartViewHolder.kt @@ -131,6 +131,12 @@ class TrafficBarChartViewHolder(parent: ViewGroup) : BlockListItemViewHolder( setDrawZeroLine(false) setDrawLabels(false) setDrawAxisLine(false) + axisMinimum = 0f + axisMaximum = if (maxYValue < minYValue) { + minYValue + } else { + roundUp(maxYValue.toFloat()) + } } chart.axisRight.apply {