1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- //
- // 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
|