MUSleepGraph
https://github.com/usadmania/MUSleepGraph
MUSleepGraph is a unique way to show data in curved line graph.
MUSleepGraph 用一种独特的方式展示了曲线图数据。
Requirements 编译环境Xcode 6 or higher
Apple LLVM compiler
iOS 7.0 or higher (May work on previous versions, just did not testit. Feel free to edit it).
ARC
Installation 安装方法Manual install 手动安装All you need to do is drop these files into your project and include headers:
需要拖动以下头文件进入您的项目中
MUSleepGraph.h and .m
GraphPoints.h and .m
UILabel+kerning.h and .m
Constants.h
Example usage 代码示例MUSleepGraph *graphView = [[MUSleepGraph alloc] initWithGraphView:self.view]; //Customize the public properties graphView.maxSleepHours = 100; graphView.numberOfWeeks = 1; NSMutableArray *yValuesArray = [NSMutableArray array]; for (int i = 0; i < 7 * graphView.numberOfWeeks; i++) { //we are going to show sleep graph for one week. //put your own values here int sleepHours = random() % self.maxGraphValue; [yValuesArray addObject:@(sleepHours)]; } graphView.labelsView = self.view; graphView.sleepHours = yValuesArray; [graphView drawSleepGraph]; [self.view addSubview:graphView];TODOAdd more customisations
Contact 作者联系方式Muhammad Usman
https://github.com/usadmania
usadmania@gmail.com