Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stats Refresh] Show grey bars when chart is empty #11887

Merged
merged 11 commits into from
Jun 11, 2019
Merged
Prev Previous commit
Next Next commit
Fix variable name after release/12.6 merge.
  • Loading branch information
ScoutHarris committed Jun 10, 2019
commit c28772d4e26cc742f65b53667d350e5a593236f9
8 changes: 4 additions & 4 deletions WordPress/Classes/ViewRelated/Stats/Charts/PeriodChart.swift
Original file line number Diff line number Diff line change
@@ -75,10 +75,10 @@ private final class PeriodChartDataTransformer {
effectiveWidth = range / effectiveBars
}

let totalViews = data.compactMap({$0.viewsCount}).reduce(0, +)
let totalVisitors = data.compactMap({$0.visitorsCount}).reduce(0, +)
let totalLikes = data.compactMap({$0.likesCount}).reduce(0, +)
let totalComments = data.compactMap({$0.commentsCount}).reduce(0, +)
let totalViews = summaryData.compactMap({$0.viewsCount}).reduce(0, +)
let totalVisitors = summaryData.compactMap({$0.visitorsCount}).reduce(0, +)
let totalLikes = summaryData.compactMap({$0.likesCount}).reduce(0, +)
let totalComments = summaryData.compactMap({$0.commentsCount}).reduce(0, +)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it!


var viewEntries = [BarChartDataEntry]()
var visitorEntries = [BarChartDataEntry]()