Giter Site home page Giter Site logo

Create monthly charts about carekit HOT 3 OPEN

egiafra avatar egiafra commented on June 8, 2024
Create monthly charts

from carekit.

Comments (3)

gavirawson-apple avatar gavirawson-apple commented on June 8, 2024

Hello! Which version of CareKit are you using, and are you building out your view in SwiftUI or UIKit? If you're interested in trying out the 3.0 beta release, we've introduced some new SwiftUI APIs that will make it really easy to map event data to a chart -

struct MonthlyChartView: View {

    private static var query: OCKEventQuery {
        let monthInterval = Calendar.current.dateInterval(of: .month, for: Date())!
        let query = OCKEventQuery(dateInterval: monthInterval)
    }

    @CareStoreFetchRequest(query: Self.query)
    private var events

    var body: some View {
        buildChartView(using: events)
    }
}

Alongside that, you can also make use of the CareTaskProgress API to aggregate the progress for multiple events and display the resulting value in the chart.

from carekit.

drdavec avatar drdavec commented on June 8, 2024

from carekit.

gavirawson-apple avatar gavirawson-apple commented on June 8, 2024

Hey Dave apologies for the late response here.

You can also stream outcomes over a date range. The CareStoreFetchRequest can be initialized with each type of care store query:

@CareStoreFetchRequest(query: OCKOutcomeQuery(dateInterval: someInterval))
private var outcomes

The decision between querying for outcomes or events will depend on what you plan to do with the data. Querying for just outcomes is probably a little bit faster, but is missing some perhaps useful information (task, event start, event end, etc.). You also won't have access to the progress computation methods available on an event. Though, it might be useful for us to provide that progress method on the outcome level as well one day.

Does that help clear up the differences?

from carekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.