Skip to content

Conversation

@bummytime
Copy link
Contributor

@bummytime bummytime commented Aug 19, 2018

charts

Title has it — this PR is the continuation of work for #177. It uses the Charts library found here... a Swift version of the same lib that Woo Android uses. The chart itself has been styled in a similar fashion to Woo Android as well.

Chart Markers

For grins, I added interactive chart markers to the iOS version (which doubles as accessibility text for each bar item). Let me know your thoughts:

chart-markers

Testing

Log into a variety of stores and see if all 4 charts (days, weeks, months, years) look "ok" (as compared to similar data you would see on the web dashboard).

@mindgraffiti and @jleandroperez would you mind taking a peek?

… feature/177-dashboard-mark6

* 'develop' of github.com:woocommerce/woocommerce-ios:
  Code review changes: `public` declaration not needed for cell variables, `guard` instead of `if let`
  Updating Authenticator to Mark 1.0.6
  Missed a whitespace
  Support empty addresses
  `pod update`
  Code review changes: make it swift-y
  Order List: Improve custom payment labels
  AppDelegate: Nukes unneeded self
  OrderStoreTests: Fixing Typo
  SettingsViewController: Simplifies downcasting
  MockupNetwork: Nukes extra dot
  AlamofireNetwork: Nukes extra space
  Order: Simplifies parsing

# Conflicts:
#	Podfile.lock
Copy link
Contributor

@mindgraffiti mindgraffiti left a comment

Choose a reason for hiding this comment

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

ui testing ✅
code review ✅


/// Returns the sum of total sales this stats period. This value is typically used in the dashboard for revenue reporting.
///
/// *Note:* The value returned here is an aggrigation of all the `OrderStatsItem.totalSales` values and
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicky - aggregation instead of aggrigation

Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

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

THIS LOOKS AWESOME!!!!!

Few nipticky comments here and there (feel free to disregard if the rounding is not really needed!!!)

offset.y = chart.bounds.size.height - origin.y - height - padding
}

return offset
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Rounding just in case the offset is not integral?

rect.origin.x -= size.width / 2.0
rect.origin.y -= size.height

context.saveGState()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: CGRect.integral just in case the positions are not integers?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same suggestion for the whole method!

extension PeriodDataViewController {
func clearAllFields() {
if barChartView != nil {
barChartView.clear()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably be the same as barChartView?.clear() ?

return
}

let marker: ChartMarker = ChartMarker(color: StyleManager.wooSecondary,
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to specify the type (: ChartMaker)


if size.height == 0.0 && image != nil {
size.height = image!.size.height
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: if let for the image, instead of the != nil and ! ?

@bummytime
Copy link
Contributor Author

Thanks for the reviews @mindgraffiti and @jleandroperez !

}


// MARK: - Constants!
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ MARK comment should be in valid format. e.g. ‘// MARK: …’ or ‘// MARK: - …’

@bummytime bummytime merged commit 5971fc4 into develop Aug 21, 2018
@bummytime bummytime deleted the feature/177-dashboard-mark6 branch August 21, 2018 19:12
@designsimply designsimply added feature: stats Related to stats, including Top Performers. and removed [Feat] Dashboard labels May 6, 2021
@AliSoftware AliSoftware added feature: stats Related to stats, including Top Performers. and removed feature: stats Related to stats, including Top Performers. labels May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: stats Related to stats, including Top Performers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants