@@ -19,4 +19,80 @@ Source code of this project is available under the standard MIT license. Please
19
19
20
20
### Bar Graph
21
21
22
- ### Line Graph
22
+ ![ Build Platform] ( images/bar-graph.png )
23
+
24
+ https://github.com/michalkonturek/GraphKit/blob/master/LICENSE
25
+
26
+ Initialize ` GKBarGraph ` from nib or programmatically:
27
+
28
+ ```
29
+ CGRect frame = CGRectMake(0, 40, 320, 200);
30
+ self.graphView = [[GKBarGraph alloc] initWithFrame:frame];
31
+ ```
32
+
33
+ then set ` GKGraphViewDataSource `
34
+
35
+ ```
36
+ self.graphView.dataSource = self;
37
+ ```
38
+
39
+ and call ` draw ` method.
40
+
41
+ ```
42
+ [self.graphView draw];
43
+ ```
44
+
45
+
46
+ Please see [ example] [ BAR ] .
47
+
48
+ [ BAR ] :https://github.com/michalkonturek/GraphKit/blob/master/GraphKit/Example/ExampleBarGraphVC.m
49
+
50
+
51
+ #### ` GKBarGraphDataSource ` Protocol
52
+
53
+ ```
54
+ @required
55
+ - (NSInteger)numberOfBars;
56
+ - (NSNumber *)valueForBarAtIndex:(NSInteger)index;
57
+
58
+ @optional
59
+ - (UIColor *)colorForBarAtIndex:(NSInteger)index;
60
+ - (CFTimeInterval)animationDurationForBarAtIndex:(NSInteger)index;
61
+ - (NSString *)titleForBarAtIndex:(NSInteger)index;
62
+ ```
63
+
64
+
65
+ ### Line Graph
66
+
67
+ ![ Build Platform] ( images/line-graph.png )
68
+
69
+ ```
70
+ CGRect frame = CGRectMake(0, 40, 320, 200);
71
+ self.graphView = [[GKLineGraph alloc] initWithFrame:frame];
72
+
73
+ self.graph.dataSource = <<data-source>>;
74
+ self.graph.lineWidth = 3.0;
75
+
76
+ [self.graph draw];
77
+ ```
78
+
79
+ Please see [ example] [ LINE ] .
80
+
81
+ [ LINE ] :https://github.com/michalkonturek/GraphKit/blob/master/GraphKit/Example/ExampleLineGraph.m
82
+
83
+
84
+ #### ` GKLineGraphDataSource ` Protocol
85
+
86
+ ```
87
+ @required
88
+ - (NSInteger)numberOfLines;
89
+ - (UIColor *)colorForLineAtIndex:(NSInteger)index;
90
+ - (NSArray *)valuesForLineAtIndex:(NSInteger)index;
91
+
92
+ @optional
93
+ - (CFTimeInterval)animationDurationForLineAtIndex:(NSInteger)index;
94
+ - (NSString *)titleForLineAtIndex:(NSInteger)index;
95
+ ```
96
+
97
+ [ @MichalKonturek ] ( https://twitter.com/MichalKonturek )
98
+
0 commit comments