-
Notifications
You must be signed in to change notification settings - Fork 22
/
LineChartView.h
53 lines (44 loc) · 1.57 KB
/
LineChartView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// LineChartView.h
// LineChart
//
// Created by Wildog on 9/16/16.
// Copyright © 2016 Wildog. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol LineChartViewDataSource, LineChartViewDelegate;
@interface LineChartView : UIView
@property (nonatomic, assign) CGFloat marginH;
@property (nonatomic, assign) CGFloat marginV;
@property (nonatomic, strong) UIColor *backgroundLineColor;
@property (nonatomic, strong) UIColor *averageLineColor;
@property (nonatomic, assign) CGFloat backgroundLineWidth;
@property (nonatomic, strong) NSArray *gradientColors;
@property (nonatomic, strong) UIColor *chartLineColor;
@property (nonatomic, assign) CGFloat chartLineWidth;
@property (nonatomic, strong) UIColor *labelColor;
@property (nonatomic, assign) CGFloat nodeSize;
@property (nonatomic, assign) CGFloat animationDuration;
@property (nonatomic, assign) BOOL animated;
@property (nonatomic, assign) BOOL gradiented;
@property (nonatomic, assign) BOOL showLabel;
@property (nonatomic, assign) BOOL showAverageLine;
@property (nonatomic, weak) id<LineChartViewDataSource> dataSource;
@property (nonatomic, weak) id<LineChartViewDelegate> delegate;
- (void)loadData;
- (void)loadDataWithSelectedKept;
@end
@protocol LineChartViewDataSource <NSObject>
@required
- (NSUInteger)numberOfElements;
- (CGFloat)maxValue;
- (CGFloat)minValue;
- (CGFloat)valueForElementAtIndex:(NSUInteger)index;
@optional
- (NSString*)labelForElementAtIndex:(NSUInteger)index;
- (CGFloat)averageValue;
@end
@protocol LineChartViewDelegate <NSObject>
@optional
- (void)clickedNodeAtIndex:(NSUInteger)index;
@end