Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/14-feature-zooming' into 14-feat…
Browse files Browse the repository at this point in the history
…ure-zooming

# Conflicts:
#	library/src/main/java/com/dzeio/charts/axis/YAxis.kt
  • Loading branch information
Aviortheking committed Feb 28, 2023
2 parents c56292b + 1a1b8da commit 603abf9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions library/src/main/java/com/dzeio/charts/axis/YAxis.kt
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ class YAxis(
return max!!
}

val max = this.lines.keys.maxOrNull() ?: 0f
val max = this.lines.keys.maxOrNull()

if (view.series.isEmpty()) {
return max
return max ?: 0f
}

if (view.type == ChartType.STACKED) {
Expand All @@ -203,6 +203,7 @@ class YAxis(
}

val localMax = nList.maxOf { it }
if (max == null) return localMax
return if (localMax > max) localMax else max
}
val seriesMax = view.series
Expand All @@ -212,6 +213,7 @@ class YAxis(
}
return@maxOf serie.getDisplayedEntries().maxOf { entry -> entry.y }
}
if (max == null) return seriesMax
return if (seriesMax > max) seriesMax else max
}

Expand All @@ -220,10 +222,10 @@ class YAxis(
return min!!
}

val min = this.lines.keys.minOrNull() ?: 0f
val min = this.lines.keys.minOrNull()

if (view.series.isEmpty()) {
return min
return min ?: 0f
}

if (view.type == ChartType.STACKED) {
Expand All @@ -248,6 +250,7 @@ class YAxis(

val localMin = nList.minOf { it }

if (min == null) return localMin
return if (localMin < min) localMin else min
}
val localMin = view.series
Expand All @@ -257,6 +260,7 @@ class YAxis(
}
return@minOf serie.getDisplayedEntries().minOf { entry -> entry.y }
}
if (min == null) return localMin
return if (localMin < min) localMin else min
}

Expand Down

0 comments on commit 603abf9

Please sign in to comment.