Skip to content

Commit

Permalink
Merge pull request #20340 from wordpress-mobile/issue/20335-fix-bar-s…
Browse files Browse the repository at this point in the history
…ize-issue-on-traffic-tab

Fix bar size issue on traffic tab
  • Loading branch information
ravishanker authored Feb 29, 2024
2 parents bf64087 + 10bbe8e commit df9fc91
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -139,7 +145,6 @@ class TrafficBarChartViewHolder(parent: ViewGroup) : BlockListItemViewHolder(
setDrawTopYLabelEntry(true)
setDrawZeroLine(false)
setDrawAxisLine(true)
granularity = 1f
axisMinimum = 0f
axisMaximum = if (maxYValue < minYValue) {
minYValue
Expand All @@ -156,7 +161,6 @@ class TrafficBarChartViewHolder(parent: ViewGroup) : BlockListItemViewHolder(

private fun configureXAxis(item: BlockListItem.BarChartItem) {
chart.xAxis.apply {
granularity = 1f
setDrawAxisLine(false)
setDrawGridLines(false)

Expand Down

0 comments on commit df9fc91

Please sign in to comment.