<|start_filename|>NKWatchChart/NKLineChartData.h<|end_filename|>
//
//  NKLineChartData.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/7/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, NKLineChartPointStyle) {
    NKLineChartPointStyleNone = 0,
    NKLineChartPointStyleCircle = 1,
    NKLineChartPointStyleSquare = 3,
    NKLineChartPointStyleTriangle = 4
};

@class NKLineChartDataItem;

typedef NKLineChartDataItem *(^LCLineChartDataGetter)(NSUInteger item);

@interface NKLineChartData : NSObject

@property (strong) UIColor *color;
@property (nonatomic) CGFloat alpha;
@property NSUInteger itemCount;
@property (copy) LCLineChartDataGetter getData;

@property (nonatomic, assign) NKLineChartPointStyle inflexionPointStyle;

/**
 * If NKLineChartPointStyle is circle, this returns the circle's diameter.
 * If NKLineChartPointStyle 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


<|start_filename|>NKWatchChart/NKRadarChartDataItem.h<|end_filename|>
//
//  NKRadarChartDataItem.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/8/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NKRadarChartDataItem : NSObject

+ (instancetype)dataItemWithValue:(CGFloat)value
                      description:(NSString *)description;

@property (nonatomic) CGFloat   value;
@property (nonatomic,copy) NSString *textDescription;

@end


<|start_filename|>NKWatchChart/NKWatchChart.h<|end_filename|>
//
//  NKWatchChart.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/6/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "NKColor.h"

#import "NKLineChart.h"
#import "NKLineChartData.h"
#import "NKLineChartDataItem.h"

#import "NKCircleChart.h"

#import "NKPieChart.h"
#import "NKPieChartDataItem.h"

#import "NKRadarChartDataItem.h"
#import "NKRadarChart.h"

#import "NKBarChart.h"


<|start_filename|>NKWatchChart/NKLineChart.h<|end_filename|>
//
//  NKLineChart.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/7/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NKLineChart : NSObject

// Background color of the chart
@property (nonatomic) UIColor *chartBackgroundColor;
// Array of `LineChartData` objects, one for each line.
@property (nonatomic) NSArray *chartData;
@property (nonatomic) CGFloat chartMargin;

@property (nonatomic) BOOL showLabel;

@property (nonatomic) NSArray *xLabels;
@property (nonatomic) NSArray *yLabels;
@property (nonatomic) CGFloat xLabelWidth;
@property (nonatomic) UIFont *xLabelFont;
@property (nonatomic) UIColor *xLabelColor;

@property (nonatomic) UIFont *yLabelFont;
@property (nonatomic) UIColor *yLabelColor;
@property (nonatomic) NSInteger yLabelNum;
@property (nonatomic) CGFloat yLabelHeight;

@property (nonatomic) CGFloat yValueMax;
@property (nonatomic) CGFloat yValueMin;
@property (nonatomic) CGFloat yFixedValueMax;
@property (nonatomic) CGFloat yFixedValueMin;

// Controls whether to show the coordinate axis. Default is NO.
@property (nonatomic, getter = isShowCoordinateAxis) BOOL showCoordinateAxis;
@property (nonatomic) UIColor *axisColor;
@property (nonatomic) CGFloat axisWidth;

@property (nonatomic, strong) NSString *xUnit;
@property (nonatomic, strong) NSString *yUnit;

// String formatter for float values in y-axis labels. If not set, defaults to @"%1.f"
@property (nonatomic, strong) NSString *yLabelFormat;

//Block formatter for custom string in y-axis labels. If not set, defaults to yLabelFormat
@property (nonatomic, copy) NSString* (^yLabelBlockFormatter)(CGFloat);

@property (nonatomic) BOOL thousandsSeparator;

- (instancetype) initWithFrame:(CGRect)frame;
- (UIImage *)drawImage;

@end

<|start_filename|>NKWatchChart/NKBarChart.h<|end_filename|>
//
//  NKBarChart.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/6/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WatchKit/WatchKit.h>

#define kXLabelMargin 8
#define kYLabelMargin 8
#define kYLabelHeight 8
#define kXLabelHeight 8

typedef NSString *(^NKYLabelFormatter)(CGFloat yLabelValue);

@interface NKBarChart : NSObject

- (id)initWithFrame:(CGRect)frame;
- (UIImage *)drawImage;

@property (nonatomic) BOOL showLabel;
@property (nonatomic) UIColor *labelTextColor;
@property (nonatomic) UIFont *labelFont;
@property (nonatomic) CGFloat labelMarginTop;

@property (nonatomic) NSArray *xLabels;
@property (nonatomic) NSInteger xLabelSkip;

@property (nonatomic) NSArray *yLabels;
@property (nonatomic) NSArray *yValues;
/** How many labels on the y-axis to skip in between displaying labels. */
@property (nonatomic) NSInteger yLabelSum;
/** Formats the ylabel text. */
@property (copy) NKYLabelFormatter yLabelFormatter;

/** Prefix to y label values, none if unset. */
@property (nonatomic) NSString *yLabelPrefix;

/** Suffix to y label values, none if unset. */
@property (nonatomic) NSString *yLabelSuffix;

/** The maximum for the range of values to display on the y-axis. */
@property (nonatomic) CGFloat yMaxValue;

/** The minimum for the range of values to display on the y-axis. */
@property (nonatomic) CGFloat yMinValue;

/** Changes chart margin. */
@property (nonatomic) CGFloat yChartLabelWidth;

@property (nonatomic) UIColor *chartBackgroundColor;
@property (nonatomic) UIColor *barBackgroundColor;
@property (nonatomic) UIColor *barColor;

@property (nonatomic) CGFloat chartMargin;

/** Corner radius for all bars in the chart. */
@property (nonatomic) CGFloat barRadius;

/** Width of all bars in the chart. */
@property (nonatomic) CGFloat barWidth;

/** Controls whether the chart border line should be displayed. */
@property (nonatomic) BOOL showChartBorder;

@property (nonatomic) UIColor *chartBorderColor;

@property (nonatomic) UIColor *strokeColor;
@property (nonatomic) NSArray *strokeColors;

@end


<|start_filename|>NKWatchChart/NKRadarChart.h<|end_filename|>
//
//  NKRadarChart.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/8/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define MAXCIRCLE 30

typedef NS_ENUM(NSUInteger, NKRadarChartLabelStyle) {
    NKRadarChartLabelStyleHorizontal = 0,
    NKRadarChartLabelStyleHidden,
};

@interface NKRadarChart : NSObject

@property (nonatomic) UIColor *chartBackgroundColor;
/** Array of `RadarChartDataItem` objects, one for each corner. */
@property (nonatomic) NSArray *chartData;
/** The unit of this chart ,default is 1 */
@property (nonatomic) CGFloat valueDivider;
/** The maximum for the range of values to display on the chart */
@property (nonatomic) CGFloat maxValue;
/** Default is gray. */
@property (nonatomic) UIColor *webColor;
/** Default is green , with an alpha of 0.7 */
@property (nonatomic) UIColor *plotColor;
/** Default is black */
@property (nonatomic) UIColor *fontColor;
/** Default is orange */
@property (nonatomic) UIColor *graduationColor;
/** Default is 15 */
@property (nonatomic) CGFloat fontSize;
/** Controls the labels display style that around chart */
@property (nonatomic, assign) NKRadarChartLabelStyle labelStyle;
/** is show graduation on the chart ,default is NO. */
@property (nonatomic, assign) BOOL isShowGraduation;

-(id)initWithFrame:(CGRect)frame  items:(NSArray *)items valueDivider:(CGFloat)unitValue;
/**
 *Draws the chart in an animated fashion.
 */
-(UIImage *)drawImage;

@end


<|start_filename|>NKWatchChart/NKPieChart.h<|end_filename|>
//
//  NKPieChart.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/8/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NKPieChart : NSObject

@property (nonatomic, readonly) NSArray	*items;

@property (nonatomic) UIColor *chartBackgroundColor;

@property (nonatomic) UIFont  *descriptionTextFont;

/** Default is white. */
@property (nonatomic) UIColor *descriptionTextColor;

/** Show only values, this is useful when legend is present */
@property (nonatomic) BOOL showOnlyValues;

/** Show absolute values not relative i.e. percentages */
@property (nonatomic) BOOL showAbsoluteValues;

- (id)initWithFrame:(CGRect)frame items:(NSArray *)items;

- (UIImage *)drawImage;

@end


<|start_filename|>NKWatchChart/NKLineChartDataItem.h<|end_filename|>
//
//  NKLineChartDataItem.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/7/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NKLineChartDataItem : NSObject

+ (NKLineChartDataItem *)dataItemWithY:(CGFloat)y;

@property (readonly) CGFloat y; // should be within the y range


@end


<|start_filename|>NKWatchChart/NKCircleChart.h<|end_filename|>
//
//  NKCircleChart.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/8/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM (NSUInteger, NKChartFormatType) {
    NKChartFormatTypePercent,
    NKChartFormatTypeDollar,
    NKChartFormatTypeNone
};

#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)

@interface NKCircleChart : NSObject

- (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;

@property (nonatomic) UIColor *chartBackgroundColor;
@property (nonatomic) UIColor *strokeColor;
@property (nonatomic) UIColor *strokeColorGradientStart;
@property (nonatomic) NSNumber *total;
@property (nonatomic) NSNumber *current;
@property (nonatomic) NSNumber *lineWidth;
@property (nonatomic) NKChartFormatType chartType;
@property (nonatomic) BOOL clockwise;
@property (nonatomic) BOOL hasBackgroundShadow;
@property (nonatomic) UIColor *backgroundShadowColor;
@property (nonatomic) BOOL displayCountingLabel;

- (UIImage *)drawImage;

@end



<|start_filename|>NKWatchChart/NKColor.h<|end_filename|>
//
//  NKColor.h
//  NKWatchChartDemo
//
//  Created by Peng on 8/6/15.
//  Copyright © 2015 Peng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NKColor : NSObject

#define NKGrey          [UIColor colorWithRed:246.0 / 255.0 green:246.0 / 255.0 blue:246.0 / 255.0 alpha:1.0f]
#define NKLightBlue     [UIColor colorWithRed:94.0 / 255.0 green:147.0 / 255.0 blue:196.0 / 255.0 alpha:1.0f]
#define NKGreen         [UIColor colorWithRed:77.0 / 255.0 green:186.0 / 255.0 blue:122.0 / 255.0 alpha:1.0f]
#define NKTitleColor    [UIColor colorWithRed:0.0 / 255.0 green:189.0 / 255.0 blue:113.0 / 255.0 alpha:1.0f]
#define NKButtonGrey    [UIColor colorWithRed:141.0 / 255.0 green:141.0 / 255.0 blue:141.0 / 255.0 alpha:1.0f]
#define NKLightGreen    [UIColor colorWithRed:77.0 / 255.0 green:216.0 / 255.0 blue:122.0 / 255.0 alpha:1.0f]
#define NKFreshGreen    [UIColor colorWithRed:77.0 / 255.0 green:196.0 / 255.0 blue:122.0 / 255.0 alpha:1.0f]
#define NKDeepGreen     [UIColor colorWithRed:77.0 / 255.0 green:176.0 / 255.0 blue:122.0 / 255.0 alpha:1.0f]
#define NKRed           [UIColor colorWithRed:245.0 / 255.0 green:94.0 / 255.0 blue:78.0 / 255.0 alpha:1.0f]
#define NKMauve         [UIColor colorWithRed:88.0 / 255.0 green:75.0 / 255.0 blue:103.0 / 255.0 alpha:1.0f]
#define NKBrown         [UIColor colorWithRed:119.0 / 255.0 green:107.0 / 255.0 blue:95.0 / 255.0 alpha:1.0f]
#define NKBlue          [UIColor colorWithRed:82.0 / 255.0 green:116.0 / 255.0 blue:188.0 / 255.0 alpha:1.0f]
#define NKDarkBlue      [UIColor colorWithRed:121.0 / 255.0 green:134.0 / 255.0 blue:142.0 / 255.0 alpha:1.0f]
#define NKYellow        [UIColor colorWithRed:242.0 / 255.0 green:197.0 / 255.0 blue:117.0 / 255.0 alpha:1.0f]
#define NKWhite         [UIColor colorWithRed:255.0 / 255.0 green:255.0 / 255.0 blue:255.0 / 255.0 alpha:1.0f]
#define NKDeepGrey      [UIColor colorWithRed:99.0 / 255.0 green:99.0 / 255.0 blue:99.0 / 255.0 alpha:1.0f]
#define NKPinkGrey      [UIColor colorWithRed:200.0 / 255.0 green:193.0 / 255.0 blue:193.0 / 255.0 alpha:1.0f]
#define NKHealYellow    [UIColor colorWithRed:245.0 / 255.0 green:242.0 / 255.0 blue:238.0 / 255.0 alpha:1.0f]
#define NKLightGrey     [UIColor colorWithRed:225.0 / 255.0 green:225.0 / 255.0 blue:225.0 / 255.0 alpha:1.0f]
#define NKCleanGrey     [UIColor colorWithRed:251.0 / 255.0 green:251.0 / 255.0 blue:251.0 / 255.0 alpha:1.0f]
#define NKLightYellow   [UIColor colorWithRed:241.0 / 255.0 green:240.0 / 255.0 blue:240.0 / 255.0 alpha:1.0f]
#define NKDarkYellow    [UIColor colorWithRed:152.0 / 255.0 green:150.0 / 255.0 blue:159.0 / 255.0 alpha:1.0f]
#define NKPinkDark      [UIColor colorWithRed:170.0 / 255.0 green:165.0 / 255.0 blue:165.0 / 255.0 alpha:1.0f]
#define NKCloudWhite    [UIColor colorWithRed:244.0 / 255.0 green:244.0 / 255.0 blue:244.0 / 255.0 alpha:1.0f]
#define NKBlack         [UIColor colorWithRed:45.0 / 255.0 green:45.0 / 255.0 blue:45.0 / 255.0 alpha:1.0f]
#define NKStarYellow    [UIColor colorWithRed:252.0 / 255.0 green:223.0 / 255.0 blue:101.0 / 255.0 alpha:1.0f]
#define NKTwitterColor  [UIColor colorWithRed:0.0 / 255.0 green:171.0 / 255.0 blue:243.0 / 255.0 alpha:1.0]
#define NKWeiboColor    [UIColor colorWithRed:250.0 / 255.0 green:0.0 / 255.0 blue:33.0 / 255.0 alpha:1.0]
#define NKiOSGreenColor [UIColor colorWithRed:98.0 / 255.0 green:247.0 / 255.0 blue:77.0 / 255.0 alpha:1.0]

- (UIImage *)imageFromColor:(UIColor *)color;

@end
