PNBarChart.h
2.6 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//
// PNBarChart.h
// PNChartDemo
//
// Created by kevin on 11/7/13.
// Copyright (c) 2013年 kevinzhow. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PNChartDelegate.h"
#import "PNBar.h"
#define xLabelMargin 15
#define yLabelMargin 15
#define yLabelHeight 11
#define xLabelHeight 20
typedef NSString *(^PNyLabelFromatter)(CGFloat yLabelValue);
@interface PNBarChart : UIView
/**
* This method will call and stroke the line in animation
*/
- (void)strokeChart;
@property (nonatomic) NSArray *xLabels;
@property (nonatomic) NSArray *yLabels;
@property (nonatomic) NSArray *yValues;
@property (nonatomic) NSMutableArray * bars;
@property (nonatomic) CGFloat xLabelWidth;
@property (nonatomic) int yValueMax;
@property (nonatomic) UIColor *strokeColor;
@property (nonatomic) NSArray *strokeColors;
/*
chartMargin changes chart margin
*/
@property (nonatomic) CGFloat yChartLabelWidth;
/*
yLabelFormatter will format the ylabel text
*/
@property (copy) PNyLabelFromatter yLabelFormatter;
/*
chartMargin changes chart margin
*/
@property (nonatomic) CGFloat chartMargin;
/*
showLabelDefines if the Labels should be deplay
*/
@property (nonatomic) BOOL showLabel;
/*
showChartBorder if the chart border Line should be deplay
*/
@property (nonatomic) BOOL showChartBorder;
/*
chartBottomLine the Line at the chart bottom
*/
@property (nonatomic) CAShapeLayer * chartBottomLine;
/*
chartLeftLine the Line at the chart left
*/
@property (nonatomic) CAShapeLayer * chartLeftLine;
/*
barRadius changes the bar corner radius
*/
@property (nonatomic) CGFloat barRadius;
/*
barWidth changes the width of the bar
*/
@property (nonatomic) CGFloat barWidth;
/*
labelMarginTop changes the width of the bar
*/
@property (nonatomic) CGFloat labelMarginTop;
/*
barBackgroundColor changes the bar background color
*/
@property (nonatomic) UIColor * barBackgroundColor;
/*
labelTextColor changes the bar label text color
*/
@property (nonatomic) UIColor * labelTextColor;
/*
labelFont changes the bar label font
*/
@property (nonatomic) UIFont * labelFont;
/*
xLabelSkip define the label skip number
*/
@property (nonatomic) NSInteger xLabelSkip;
/*
yLabelSum define the label sum number
*/
@property (nonatomic) NSInteger yLabelSum;
/*
yMaxValue define the max value of the chart
*/
@property (nonatomic) CGFloat yMaxValue;
/*
yMinValue define the min value of the chart
*/
@property (nonatomic) CGFloat yMinValue;
/*
switch to indicate that the bar should be filled as a gradient
*/
@property (nonatomic) UIColor *barColorGradientStart;
@property (nonatomic, retain) id<PNChartDelegate> delegate;
@end