单军华
2017-03-10 705dd5bda8a6cdbc97b65e9b046bdf49739cc87b
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
54
55
56
57
58
59
60
61
//
// Created by Jörg Polakowski on 14/12/13.
// Copyright (c) 2013 kevinzhow. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
 
typedef NS_ENUM(NSUInteger, PNLineChartPointStyle) {
    PNLineChartPointStyleNone = 0,
    PNLineChartPointStyleCircle = 1,
    PNLineChartPointStyleSquare = 3,
    PNLineChartPointStyleTriangle = 4
};
 
@class PNLineChartDataItem;
 
typedef PNLineChartDataItem *(^LCLineChartDataGetter)(NSUInteger item);
 
@interface PNLineChartColorRange : NSObject<NSCopying>
 
@property(nonatomic) NSRange range;
@property(nonatomic) BOOL inclusive;
@property(nonatomic, retain) UIColor *color;
 
- (id)initWithRange:(NSRange)range color:(UIColor *)color;
 
@end
 
@interface PNLineChartData : NSObject
 
@property (strong) UIColor *color;
@property (nonatomic) CGFloat alpha;
@property NSUInteger itemCount;
@property (copy) LCLineChartDataGetter getData;
@property (strong, nonatomic) NSString *dataTitle;
 
@property (nonatomic) BOOL showPointLabel;
@property (nonatomic) UIColor *pointLabelColor;
@property (nonatomic) UIFont *pointLabelFont;
@property (nonatomic) NSString *pointLabelFormat;
 
@property (nonatomic, assign) PNLineChartPointStyle inflexionPointStyle;
@property (nonatomic) UIColor *inflexionPointColor;
 
/**
 * if rangeColor is set and the lineChartData values are within any
 * of the given range then use the rangeColor.color otherwise use
 * self.color for the rest of the graph
 */
@property(strong) NSArray<PNLineChartColorRange *> *rangeColors;
 
/**
 * If PNLineChartPointStyle is circle, this returns the circle's diameter.
 * If PNLineChartPointStyle is square, each point is a square with each side equal in length to this value.
 */
@property (nonatomic, assign) CGFloat inflexionPointWidth;
 
@property (nonatomic, assign) CGFloat lineWidth;
 
@end