carekit-apple/CareKit

Ability to create charts over other time periods

Closed this issue · 2 comments

I need to be able to display a chart that shows data over a time period longer than a week. It looks to me like all OCKChartControllers are hard-coded to only show one week's worth of data.

Is there any way to alter or extend this functionality? Is my best option to just create a new OCKCardable from scratch? Or vust my own controller that conforms to OCKChartControllerProtocol? Is there any plan to add support for charts over a different time frame? Limiting them to one week seems to greatly impact the usefulness of this feature.

Yes, the current OCKChartViewController only supports a week of data. You can modify the implementation to support a longer time frame, see the eventQuery used by the controller for a good start. Depending on the requirements for your chart, the most difficult part might be creating a custom view that displays the longer date range if panning is needed.

We don't currently have plans to support a larger time frame, but it's something we can think about if it's useful for folks.

Interesting. Thank you.