|
@@ -0,0 +1,73 @@
|
|
|
+//
|
|
|
+// PNCircleChart.h
|
|
|
+// PNChartDemo
|
|
|
+//
|
|
|
+// Created by kevinzhow on 13-11-30.
|
|
|
+// Copyright (c) 2013年 kevinzhow. All rights reserved.
|
|
|
+//
|
|
|
+
|
|
|
+#import <UIKit/UIKit.h>
|
|
|
+#import "UICountingLabel.h"
|
|
|
+
|
|
|
+typedef NS_ENUM (NSUInteger, PNChartFormatType) {
|
|
|
+ PNChartFormatTypePercent,
|
|
|
+ PNChartFormatTypeDollar,
|
|
|
+ PNChartFormatTypeNone,
|
|
|
+ PNChartFormatTypeDecimal,
|
|
|
+ PNChartFormatTypeDecimalTwoPlaces,
|
|
|
+};
|
|
|
+
|
|
|
+#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
|
|
|
+
|
|
|
+@interface PNCircleChart : UIView
|
|
|
+
|
|
|
+- (void)strokeChart;
|
|
|
+- (void)growChartByAmount:(NSNumber *)growAmount;
|
|
|
+- (void)updateChartByCurrent:(NSNumber *)current;
|
|
|
+- (void)updateChartByCurrent:(NSNumber *)current byTotal:(NSNumber *)total;
|
|
|
+//- (id)initWithFrame:(CGRect)frame
|
|
|
+// total:(NSNumber *)total
|
|
|
+// current:(NSNumber *)current
|
|
|
+// clockwise:(BOOL)clockwise;
|
|
|
+//
|
|
|
+//- (id)initWithFrame:(CGRect)frame
|
|
|
+// total:(NSNumber *)total
|
|
|
+// current:(NSNumber *)current
|
|
|
+// clockwise:(BOOL)clockwise
|
|
|
+// shadow:(BOOL)hasBackgroundShadow
|
|
|
+// shadowColor:(UIColor *)backgroundShadowColor;
|
|
|
+//
|
|
|
+//- (id)initWithFrame:(CGRect)frame
|
|
|
+// total:(NSNumber *)total
|
|
|
+// current:(NSNumber *)current
|
|
|
+// clockwise:(BOOL)clockwise
|
|
|
+// shadow:(BOOL)hasBackgroundShadow
|
|
|
+// shadowColor:(UIColor *)backgroundShadowColor
|
|
|
+//displayCountingLabel:(BOOL)displayCountingLabel;
|
|
|
+
|
|
|
+- (id)initWithFrame:(CGRect)frame
|
|
|
+ total:(NSNumber *)total
|
|
|
+ current:(NSNumber *)current
|
|
|
+ clockwise:(BOOL)clockwise
|
|
|
+ shadow:(BOOL)hasBackgroundShadow
|
|
|
+ shadowColor:(UIColor *)backgroundShadowColor
|
|
|
+displayCountingLabel:(BOOL)displayCountingLabel
|
|
|
+ overrideLineWidth:(NSNumber *)overrideLineWidth
|
|
|
+ strokeColor:(UIColor *)strokeColor;
|
|
|
+@property (strong, nonatomic) UICountingLabel *countingLabel;
|
|
|
+@property (nonatomic) UIColor *strokeColor;
|
|
|
+@property (nonatomic) UIColor *strokeColorGradientStart;
|
|
|
+@property (nonatomic) NSNumber *total;
|
|
|
+@property (nonatomic) NSNumber *current;
|
|
|
+@property (nonatomic) NSNumber *lineWidth;
|
|
|
+@property (nonatomic) NSTimeInterval duration;
|
|
|
+@property (nonatomic) PNChartFormatType chartType;
|
|
|
+
|
|
|
+@property (nonatomic) CAShapeLayer *circle;
|
|
|
+@property (nonatomic) CAShapeLayer *gradientMask;
|
|
|
+@property (nonatomic) CAShapeLayer *circleBackground;
|
|
|
+
|
|
|
+@property (nonatomic) BOOL displayCountingLabel;
|
|
|
+@property (nonatomic) BOOL displayAnimated;
|
|
|
+
|
|
|
+@end
|