├── HUChartDemo
├── en.lproj
│ └── InfoPlist.strings
├── HUViewController.h
├── main.m
├── HUChartDemo-Prefix.pch
├── HUAppDelegate.h
├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ └── Contents.json
├── HUChartDemo-Info.plist
├── HUAppDelegate.m
└── HUViewController.m
├── HUChartDemoTests
├── en.lproj
│ └── InfoPlist.strings
├── HUChartDemoTests-Info.plist
└── HUChartDemoTests.m
├── HUChartDemo.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── SCN.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── HUChartDemo.xcscheme
└── project.pbxproj
├── HUChart
├── HUChartEntry.h
├── HUChartEntry.m
├── HUSemiCircleChart.h
└── HUSemiCircleChart.m
├── HUChart.podspec
├── LICENSE
└── README.md
/HUChartDemo/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/HUChartDemoTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/HUChartDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/HUChartDemo/HUViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // HUViewController.h
3 | // HUChart
4 | //
5 | // Created by hugo on 11/19/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface HUViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/HUChart/HUChartEntry.h:
--------------------------------------------------------------------------------
1 | //
2 | // HUChartEntry.h
3 | // HUChart
4 | //
5 | // Created by hugo on 11/24/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface HUChartEntry : NSObject
12 | @property NSString *name;
13 | @property NSNumber *value;
14 |
15 | -(id)initWithName:(NSString*) _name value:(NSNumber *) _value;
16 | @end
17 |
--------------------------------------------------------------------------------
/HUChartDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // HUChartDemo
4 | //
5 | // Created by hugo on 11/24/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "HUAppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([HUAppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/HUChartDemo/HUChartDemo-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_3_0
10 | #warning "This project uses features only available in iOS SDK 3.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/HUChartDemo/HUAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // HUAppDelegate.h
3 | // HUChartDemo
4 | //
5 | // Created by hugo on 11/24/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "HUViewController.h"
11 |
12 | @interface HUAppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 | @property (strong, nonatomic) HUViewController *huViewController;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/HUChart.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "HUChart"
3 | s.version = "1.0.0"
4 | s.summary = "A simple semi-circle chart."
5 | s.homepage = "https://github.com/hugo53/HUChart"
6 | s.license = 'MIT'
7 | s.author = { "Minh Hoang Nguyen" => "hoangnm.53@gmail.com" }
8 | s.platform = :ios, '6.1'
9 | s.source = { :git => "https://github.com/hugo53/HUChart.git", :tag => "1.0.0" }
10 | s.source_files = 'HUChart', 'HUChart/**/*.{h,m}'
11 | s.requires_arc = true
12 | end
13 |
--------------------------------------------------------------------------------
/HUChart/HUChartEntry.m:
--------------------------------------------------------------------------------
1 | //
2 | // HUChartEntry.m
3 | // HUChart
4 | //
5 | // Created by hugo on 11/24/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import "HUChartEntry.h"
10 |
11 | @implementation HUChartEntry
12 | @synthesize name;
13 | @synthesize value;
14 |
15 | - (id)init
16 | {
17 | self = [super init];
18 | if (self) {
19 | self.name = @"";
20 | value = [NSNumber numberWithFloat:-1.0];
21 | }
22 | return self;
23 | }
24 |
25 | -(id)initWithName:(NSString*) _name value:(NSNumber *) _value{
26 | self = [super init];
27 | if (self) {
28 | self.name = _name;
29 | self.value = _value;
30 | }
31 | return self;
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/HUChartDemo.xcodeproj/xcuserdata/SCN.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | HUChartDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 668474011841BE3500EF13BE
16 |
17 | primary
18 |
19 |
20 | 6684741C1841BE3500EF13BE
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/HUChartDemoTests/HUChartDemoTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.hugo.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/HUChartDemoTests/HUChartDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // HUChartDemoTests.m
3 | // HUChartDemoTests
4 | //
5 | // Created by hugo on 11/24/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface HUChartDemoTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation HUChartDemoTests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/HUChartDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "29x29",
21 | "scale" : "1x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "29x29",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "40x40",
31 | "scale" : "1x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "40x40",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "76x76",
41 | "scale" : "1x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "76x76",
46 | "scale" : "2x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 HUGO
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/HUChart/HUSemiCircleChart.h:
--------------------------------------------------------------------------------
1 | //
2 | // HUSemiCircleChart.h
3 | // HUChart
4 | //
5 | // Created by hugo on 11/19/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #ifdef DEBUG
12 | # define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
13 | #else
14 | # define DLog(...)
15 | #endif
16 |
17 | typedef enum showTextType
18 | {
19 | DONT_SHOW_PORTION,
20 | SHOW_PORTION_VALUE,
21 | SHOW_PORTION_TEXT
22 | } ShowTextType;
23 |
24 | @interface HUSemiCircleChart : UIView
25 |
26 | @property (nonatomic) NSMutableArray *data; // Data for presenting chart, contain HUChartEntry
27 | @property (nonatomic) NSMutableArray *colors; // Colour for each element, contain UIColor
28 | @property (nonatomic) NSString *title; // Chart title
29 | @property (nonatomic) ShowTextType showPortionTextType; // Show text/value/nothing for each portion. Default=SHOW_PORTION_TEXT
30 | @property (assign) BOOL showChartTitle; // Show chart title (Default:YES)
31 | @property (nonatomic) NSString *fontName; // Name of the font you would like to use (Optional)
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/HUChartDemo/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
--------------------------------------------------------------------------------
/HUChartDemo/HUChartDemo-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | com.hugo.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/HUChartDemo/HUAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // HUAppDelegate.m
3 | // HUChartDemo
4 | //
5 | // Created by hugo on 11/24/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import "HUAppDelegate.h"
10 |
11 | @implementation HUAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
16 | // Override point for customization after application launch.
17 |
18 | self.huViewController = [[HUViewController alloc] init];
19 | self.window.rootViewController = self.huViewController;
20 |
21 | self.window.backgroundColor = [UIColor whiteColor];
22 | [self.window makeKeyAndVisible];
23 | return YES;
24 | }
25 |
26 | - (void)applicationWillResignActive:(UIApplication *)application
27 | {
28 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
29 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
30 | }
31 |
32 | - (void)applicationDidEnterBackground:(UIApplication *)application
33 | {
34 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
36 | }
37 |
38 | - (void)applicationWillEnterForeground:(UIApplication *)application
39 | {
40 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
41 | }
42 |
43 | - (void)applicationDidBecomeActive:(UIApplication *)application
44 | {
45 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
46 | }
47 |
48 | - (void)applicationWillTerminate:(UIApplication *)application
49 | {
50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
51 | }
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/HUChartDemo/HUViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // HUViewController.m
3 | // HUChart
4 | //
5 | // Created by hugo on 11/19/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import "HUViewController.h"
10 | #import "HUSemiCircleChart.h"
11 | #import "HUChartEntry.h"
12 |
13 | @interface HUViewController ()
14 |
15 | @end
16 |
17 | @implementation HUViewController
18 |
19 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
20 | {
21 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
22 | if (self) {
23 | // Custom initialization
24 | }
25 | return self;
26 | }
27 |
28 | - (void)viewDidLoad
29 | {
30 | [super viewDidLoad];
31 | // Do any additional setup after loading the view.
32 | CGRect frame = CGRectMake(25, 30, 250, 300);
33 | HUSemiCircleChart *semiCircleChart = [[HUSemiCircleChart alloc]
34 | initWithFrame:frame];
35 |
36 | // Setup data
37 | // Data from http://www.w3schools.com/browsers/browsers_stats.asp
38 | // Browser Statistics, October, 2013
39 | NSMutableArray *data = [NSMutableArray arrayWithObjects:
40 | [[HUChartEntry alloc]initWithName:@"Chrome" value:@54.1],
41 | [[HUChartEntry alloc]initWithName:@"Firefox" value:@27.2],
42 | [[HUChartEntry alloc]initWithName:@"IE" value:@11.7],
43 | [[HUChartEntry alloc]initWithName:@"Safari" value:@3.8],
44 | [[HUChartEntry alloc]initWithName:@"Others" value:@3.2],
45 | nil];
46 |
47 | //colors maybe not setup, will be generated automatically
48 | UIColor * color1 = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0];
49 | UIColor * color2 = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0];
50 | UIColor * color3 = [UIColor colorWithRed:0.0 green:0.5 blue:0.0 alpha:1.0];
51 | UIColor * color4 = [UIColor colorWithRed:1.0 green:0.0 blue:1.0 alpha:1.0];
52 | UIColor * color5 = [UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];
53 |
54 | NSMutableArray *colors = [NSMutableArray arrayWithObjects: color1, color2,
55 | color3, color4,
56 | color5, nil];
57 | [semiCircleChart setColors:colors];
58 | [semiCircleChart setData:data];
59 | [semiCircleChart setTitle:@"Browser Shared"];
60 | semiCircleChart.showPortionTextType = SHOW_PORTION_TEXT;
61 | // semiCircleChart.showPortionTextType = SHOW_PORTION_VALUE;
62 | // semiCircleChart.showPortionTextType = DONT_SHOW_PORTION;
63 |
64 | [self.view addSubview:semiCircleChart];
65 | }
66 |
67 | - (void)didReceiveMemoryWarning
68 | {
69 | [super didReceiveMemoryWarning];
70 | // Dispose of any resources that can be recreated.
71 | }
72 |
73 | @end
74 |
--------------------------------------------------------------------------------
/HUChartDemo.xcodeproj/xcuserdata/SCN.xcuserdatad/xcschemes/HUChartDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HUChart
2 | HUChart is a simple chart library for iOS to draw semi-circle chart for some cases which has a LITTLE SPACE to make a full circle chart.
3 |
4 | 
5 |
6 | 
7 |
8 | > Data for above charts is owned by [http://www.w3schools.com/browsers/browsers_stats.asp](http://www.w3schools.com/browsers/browsers_stats.asp)
9 |
10 |
11 | ## Features
12 | - Semi-circle chart (half pie chart) as an UIView Component. Easy to customize a suitable semi-circle chart without any struggle.
13 | - Support iOS 6.1+
14 | - Support ARC
15 |
16 | #### TO-DO
17 | - Support Touchable
18 | - Support Slice Position Editable, i.e drag \& drop slice to rearrange slice order
19 | - Support Data Updatable, i.e: change portion of specific slice or add slice
20 |
21 | ## Usage
22 | The code below shows you how to use this SemiCircleChart. You can customize data, color, chart title and the way text is displayed.
23 |
24 | ```objective-c
25 | // Step 1: Create HUSemiCircleChart object with its desire frame
26 | CGRect frame = CGRectMake(25, 30, 250, 300);
27 | HUSemiCircleChart *semiCircleChart = [[HUSemiCircleChart alloc]
28 | initWithFrame:frame];
29 |
30 | // Step 2: Setup data
31 | NSMutableArray *data = [NSMutableArray arrayWithObjects:
32 | [[HUChartEntry alloc]initWithName:@"Chrome" value:@54.1],
33 | [[HUChartEntry alloc]initWithName:@"Firefox" value:@27.2],
34 | [[HUChartEntry alloc]initWithName:@"IE" value:@11.7],
35 | [[HUChartEntry alloc]initWithName:@"Safari" value:@3.8],
36 | [[HUChartEntry alloc]initWithName:@"Others" value:@3.2],
37 | nil];
38 | [semiCircleChart setData:data];
39 |
40 | // Step 3: Setup color (Optional)
41 | // colors maybe not setup, will be generated automatically
42 | UIColor * color1 = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0];
43 | UIColor * color2 = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0];
44 | UIColor * color3 = [UIColor colorWithRed:0.0 green:0.5 blue:0.0 alpha:1.0];
45 | UIColor * color4 = [UIColor colorWithRed:1.0 green:0.0 blue:1.0 alpha:1.0];
46 | UIColor * color5 = [UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];
47 |
48 | NSMutableArray *colors = [NSMutableArray arrayWithObjects: color1, color2,
49 | color3, color4,
50 | color5, nil];
51 | [semiCircleChart setColors:colors];
52 |
53 | // Step 4: Setup Chart Title
54 | [semiCircleChart setTitle:@"Browser Shared"];
55 |
56 | // Step 5: Determine whether chart element text is shown or not.
57 | // SHOW_PORTION_TEXT to show element's name
58 | // SHOW_PORTION_VALUE to show element's value
59 | // DONT_SHOW_PORTION to show element without any text
60 | semiCircleChart.showPortionTextType = SHOW_PORTION_TEXT;
61 | ```
62 |
63 | ## Installation
64 | Two ways:
65 | - Use CocoaPods
66 |
67 | ```ruby
68 | platform :ios, 6.1
69 |
70 | pod 'HUChart'
71 | ```
72 |
73 | - Drop \& Drag HUChart folder into your project. It's easy!
74 |
75 | ## Contribution
76 | - This work is happened thanks to an idea from [Dao-Thai Nguyen](https://www.facebook.com/profile.php?id=1566842679). He also gave me some precious advice to accomplish HUChart.
77 | - By spreading this hub, [Van-Tam Nguyen](https://github.com/VanTamNguyen), [Duy-Thanh Le](https://github.com/yoyo158), [Ngoc-Linh Le](https://github.com/mrleolink) and [Dai-Thanh Nguyen](https://github.com/thanhnd550) helped the hub reach to more people, so it may help someone. Thanks for their job!
78 | - Don't hesitate to send a pull request or open an issue if you want me to improve something.
79 |
80 | ## License
81 | HUChart is released under the MIT License, see [LICENSE](https://github.com/hugo53/HUChart/blob/master/LICENSE).
82 |
83 |
84 | [](https://bitdeli.com/free "Bitdeli Badge")
85 |
86 |
--------------------------------------------------------------------------------
/HUChart/HUSemiCircleChart.m:
--------------------------------------------------------------------------------
1 | //
2 | // HUSemiCircleChart.m
3 | // HUChart
4 | //
5 | // Created by hugo on 11/19/13.
6 | // Copyright (c) 2013 AugoLab. All rights reserved.
7 | //
8 |
9 | #import "HUSemiCircleChart.h"
10 | #import "HUChartEntry.h"
11 |
12 | @implementation HUSemiCircleChart
13 | @synthesize data;
14 | @synthesize colors;
15 | @synthesize title;
16 | @synthesize showChartTitle;
17 | @synthesize showPortionTextType;
18 | @synthesize fontName;
19 |
20 | -(id) init{
21 | self = [super init];
22 | self.title = @""; //default title
23 | self.showChartTitle = YES;
24 | self.showPortionTextType = SHOW_PORTION_TEXT;
25 | return self;
26 | }
27 |
28 | -(id) initWithFrame:(CGRect) frame{
29 | self = [super initWithFrame:frame];
30 | self.title = @""; //default title
31 | self.showChartTitle = YES;
32 | self.showPortionTextType = SHOW_PORTION_TEXT;
33 | return self;
34 | }
35 |
36 | /**
37 | * Gen random colours array if user doesn't set colors property
38 | */
39 | -(void) genColors{
40 | int amount = [self.data count];
41 | UIColor *color;
42 | float red, green, blue;
43 |
44 | for (int i = 0; i < amount; i++) {
45 | // Just gen color in range (0,0,0) to (192, 192, 192)
46 | // to prevent too bright color
47 | red = arc4random_uniform(192)/255.0;
48 | green = arc4random_uniform(192)/255.0;
49 | blue = arc4random_uniform(192)/255.0;
50 |
51 | color = [UIColor colorWithRed:(CGFloat)red
52 | green:(CGFloat)green
53 | blue:(CGFloat)blue
54 | alpha:1.0];
55 |
56 | // Lazy initialization
57 | if (!self.colors) {
58 | self.colors = [[NSMutableArray alloc]init];
59 | }
60 | [self.colors addObject:color];
61 | }
62 | }
63 |
64 | /**
65 | * Override drawRect method to draw SemiCircleChart
66 | *
67 | * @param rect frame to draw into
68 | */
69 |
70 | -(void) drawRect:(CGRect)rect{
71 | [super drawRect:rect];
72 |
73 | // Check passed rect is suitable for drawing
74 | if (![self isDrawable:rect]) {
75 | return;
76 | }
77 |
78 | CGContextRef context = UIGraphicsGetCurrentContext();
79 | [[UIColor whiteColor]set];
80 | UIRectFill([self bounds]);
81 |
82 | // Draw
83 | float R = rect.size.width/2;
84 | float r = 2*R/5;
85 | CGPoint origin = CGPointMake(rect.origin.x + rect.size.width/2,
86 | rect.origin.y + 5*rect.size.height/6);
87 |
88 | // Draw large circle
89 | [self drawCircleInContext:context withRadian:r atOrigin:origin];
90 |
91 | // Draw small circle
92 | [self drawCircleInContext:context withRadian:r atOrigin:origin];
93 |
94 | // Draw portions
95 | float startAngle = 0.0;
96 | float endAngle = 0.0;
97 | NSMutableArray *percentages = [self getPortions];
98 |
99 | if (!self.colors) {
100 | // If colors property is not set, gen colors
101 | [self genColors];
102 | }
103 |
104 | // Draw portions
105 | for (int i = 0; i < [self.data count]; i++) {
106 | endAngle = [[percentages objectAtIndex:i] floatValue];
107 |
108 | // Draw each portion
109 | [self drawPortionInContext:context
110 | withColor:[self.colors objectAtIndex:i]
111 | origin:origin R:R r:r
112 | startAngle:startAngle endAngle:endAngle];
113 |
114 | // Draw text or value of portion or nothing
115 | switch ([self showPortionTextType]) {
116 | case SHOW_PORTION_TEXT:
117 | [self drawPortionValue:[[self.data objectAtIndex:i] name]
118 | inContext:context
119 | origin:origin R:R r:r
120 | startAngle:startAngle endAngle:endAngle];
121 | break;
122 |
123 | case SHOW_PORTION_VALUE:
124 | [self drawPortionValue:[(HUChartEntry*)
125 | [self.data objectAtIndex:i] value]
126 | inContext:context
127 | origin:origin R:R r:r
128 | startAngle:startAngle endAngle:endAngle];
129 | break;
130 | case DONT_SHOW_PORTION:
131 | break;
132 | default:
133 | break;
134 | }
135 |
136 | startAngle = endAngle;
137 | }
138 |
139 | // Draw title if it is set
140 | if (self.showChartTitle) {
141 | UIFont *font = nil;
142 |
143 | if (fontName) {
144 | font = [UIFont fontWithName:fontName size:r/4];
145 | } else {
146 | font = [UIFont boldSystemFontOfSize:r/4];
147 | }
148 |
149 | [self drawText:self.title
150 | withFont:font withColor:[UIColor blackColor]
151 | inContext:context inRect:CGRectMake(R-r*sqrt(3)/2,
152 | origin.y - r/2,
153 | 2*r*sqrt(3)/2,
154 | 3*r/2)];
155 | }
156 | }
157 |
158 |
159 | - (void)drawCircleInContext:(CGContextRef)context
160 | withRadian:(float)r atOrigin:(CGPoint)origin {
161 | CGContextSaveGState(context);
162 | CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0);
163 | CGContextSetLineWidth(context, 0.0);
164 | CGContextAddArc(context, origin.x, origin.y, r, 0, M_PI, YES);
165 | CGContextClosePath(context);
166 | CGContextStrokePath(context);
167 | CGContextRestoreGState(context);
168 | }
169 |
170 | - (void)drawPortionInContext:(CGContextRef)context withColor:(UIColor*) color
171 | origin:(CGPoint)origin R:(float)R r:(float)r
172 | startAngle:(float)startAngle endAngle:(float)endAngle
173 | {
174 | CGRect rect = CGContextGetClipBoundingBox(context);
175 | int unitStep = 512;
176 |
177 | if (rect.size.width >= 300) {
178 | unitStep = 1024;
179 | }else if(rect.size.width >= 500){
180 | unitStep = 2048;
181 | }
182 |
183 | float drawStep = M_PI/unitStep;
184 |
185 | CGContextSaveGState(context);
186 | CGContextSetStrokeColorWithColor(context, [color CGColor]);
187 | CGContextSetFillColorWithColor(context, [color CGColor]);
188 | CGContextSetLineWidth(context, 1.0);
189 |
190 | for (float drawingAngle = startAngle;
191 | drawingAngle <= endAngle;
192 | drawingAngle += drawStep) {
193 |
194 | CGContextMoveToPoint(context,
195 | origin.x - r*cos(drawingAngle),
196 | origin.y - r*sin(drawingAngle));
197 | CGContextAddLineToPoint(context,
198 | R *(1- cos(drawingAngle)),
199 | origin.y - R*sin(drawingAngle));
200 | CGContextClosePath(context);
201 | CGContextStrokePath(context);
202 | }
203 |
204 | CGContextRestoreGState(context);
205 | }
206 |
207 | - (void)drawText:(NSString *) text
208 | withFont:(UIFont *) font withColor:(UIColor *) color
209 | inContext:(CGContextRef)context inRect:(CGRect) textRect {
210 |
211 | if (text.length > 0) {
212 | CGContextSaveGState(context);
213 | [color setFill]; // Fill current context with color
214 |
215 | if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
216 | NSMutableParagraphStyle *textStyle = [[NSMutableParagraphStyle
217 | defaultParagraphStyle] mutableCopy];
218 | textStyle.lineBreakMode = NSLineBreakByWordWrapping;
219 | textStyle.alignment = NSTextAlignmentCenter;
220 | NSDictionary *attributes = @{NSFontAttributeName:font,
221 | NSParagraphStyleAttributeName:textStyle};
222 | [text drawInRect:textRect withAttributes:attributes];
223 | }else{
224 | [text drawInRect:textRect
225 | withFont:font
226 | lineBreakMode:NSLineBreakByWordWrapping
227 | alignment:NSTextAlignmentCenter];
228 | }
229 |
230 | CGContextRestoreGState(context);
231 | }
232 | }
233 |
234 | - (void)drawPortionValue:(id) portionValue inContext:(CGContextRef)context
235 | origin:(CGPoint)origin R:(float)R r:(float)r
236 | startAngle:(float)startAngle endAngle:(float)endAngle {
237 |
238 | UIFont *font = nil;
239 | if (fontName) {
240 | font = [UIFont fontWithName:fontName size:r/4];
241 | } else {
242 | font = [UIFont boldSystemFontOfSize:r/4];
243 | }
244 |
245 |
246 | NSString *portionValueText;
247 | if ([portionValue isKindOfClass:[NSNumber class]]) {
248 | portionValueText = [portionValue stringValue];
249 | }else if ([portionValue isKindOfClass:[NSString class]]) {
250 | portionValueText = (NSString *)portionValue;
251 | }
252 |
253 | CGSize portionValueTextSize;
254 | if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
255 | portionValueTextSize = [portionValueText sizeWithAttributes:
256 | @{NSFontAttributeName: font}];
257 | }else{
258 | portionValueTextSize = [portionValueText sizeWithFont:font];
259 | }
260 |
261 | float midAngle = (startAngle + endAngle)/2;
262 |
263 | CGPoint midPoint = CGPointMake((CGFloat) R *(1- 4*cos(midAngle)/5),
264 | (CGFloat)(origin.y - 4*R*sin(midAngle)/5));
265 |
266 | CGRect portionValueTextRect = CGRectMake(
267 | midPoint.x - portionValueTextSize.width/2.0,
268 | midPoint.y - portionValueTextSize.height/2.0,
269 | portionValueTextSize.width,
270 | portionValueTextSize.height
271 | );
272 |
273 | [self drawText:portionValueText
274 | withFont:font withColor:[UIColor whiteColor]
275 | inContext:context inRect:portionValueTextRect];
276 |
277 | }
278 |
279 | - (BOOL)isDrawable:(CGRect)rect {
280 | if (rect.size.height < rect.size.width/2.0) {
281 | [[UIColor yellowColor]set];
282 | UIRectFill([self bounds]);
283 |
284 | UIFont *font = nil;
285 | if (fontName) {
286 | font = [UIFont fontWithName:fontName size:MIN(rect.size.width/25.0, 12)];
287 | } else {
288 | font = [UIFont boldSystemFontOfSize:MIN(rect.size.width/25.0, 12)];
289 | }
290 |
291 |
292 | [self drawText: @"Cannot draw because rect height is too small."
293 | @"\nPlease sure that rect height >= rect width/2"
294 | withFont:font withColor:[UIColor blackColor]
295 | inContext:UIGraphicsGetCurrentContext()
296 | inRect:CGRectMake(rect.origin.x,
297 | rect.origin.y + rect.size.height/3,
298 | rect.size.width,
299 | rect.size.height)];
300 |
301 | return NO;
302 | }
303 | return YES;
304 | }
305 |
306 | - (NSMutableArray *)getPortions {
307 | NSMutableArray *percentages = [[NSMutableArray alloc]
308 | initWithCapacity:[self.data count]];
309 |
310 | float total = 0.0;
311 | for (HUChartEntry *entry in self.data) {
312 | total += [[entry value] floatValue];
313 | }
314 |
315 | float temp_total = 0.0;
316 | for(HUChartEntry *entry in self.data){
317 | temp_total += [[entry value] floatValue];
318 | // Convert from 100-based to PI-based
319 | float percentage = (temp_total/total) * M_PI;
320 | [percentages addObject:[NSNumber numberWithFloat:percentage]];
321 | }
322 | return percentages;
323 | }
324 |
325 | @end
326 |
--------------------------------------------------------------------------------
/HUChartDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 668474061841BE3500EF13BE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 668474051841BE3500EF13BE /* Foundation.framework */; };
11 | 668474081841BE3500EF13BE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 668474071841BE3500EF13BE /* CoreGraphics.framework */; };
12 | 6684740A1841BE3500EF13BE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 668474091841BE3500EF13BE /* UIKit.framework */; };
13 | 668474101841BE3500EF13BE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6684740E1841BE3500EF13BE /* InfoPlist.strings */; };
14 | 668474121841BE3500EF13BE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 668474111841BE3500EF13BE /* main.m */; };
15 | 668474161841BE3500EF13BE /* HUAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 668474151841BE3500EF13BE /* HUAppDelegate.m */; };
16 | 668474181841BE3500EF13BE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 668474171841BE3500EF13BE /* Images.xcassets */; };
17 | 6684741F1841BE3500EF13BE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6684741E1841BE3500EF13BE /* XCTest.framework */; };
18 | 668474201841BE3500EF13BE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 668474051841BE3500EF13BE /* Foundation.framework */; };
19 | 668474211841BE3500EF13BE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 668474091841BE3500EF13BE /* UIKit.framework */; };
20 | 668474291841BE3500EF13BE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 668474271841BE3500EF13BE /* InfoPlist.strings */; };
21 | 6684742B1841BE3500EF13BE /* HUChartDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6684742A1841BE3500EF13BE /* HUChartDemoTests.m */; };
22 | 668474391841BE9100EF13BE /* HUChartEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 668474361841BE9100EF13BE /* HUChartEntry.m */; };
23 | 6684743A1841BE9100EF13BE /* HUSemiCircleChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 668474381841BE9100EF13BE /* HUSemiCircleChart.m */; };
24 | 6684743D1841BEC600EF13BE /* HUViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6684743C1841BEC600EF13BE /* HUViewController.m */; };
25 | /* End PBXBuildFile section */
26 |
27 | /* Begin PBXContainerItemProxy section */
28 | 668474221841BE3500EF13BE /* PBXContainerItemProxy */ = {
29 | isa = PBXContainerItemProxy;
30 | containerPortal = 668473FA1841BE3500EF13BE /* Project object */;
31 | proxyType = 1;
32 | remoteGlobalIDString = 668474011841BE3500EF13BE;
33 | remoteInfo = HUChartDemo;
34 | };
35 | /* End PBXContainerItemProxy section */
36 |
37 | /* Begin PBXFileReference section */
38 | 668474021841BE3500EF13BE /* HUChartDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HUChartDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
39 | 668474051841BE3500EF13BE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
40 | 668474071841BE3500EF13BE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
41 | 668474091841BE3500EF13BE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
42 | 6684740D1841BE3500EF13BE /* HUChartDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HUChartDemo-Info.plist"; sourceTree = ""; };
43 | 6684740F1841BE3500EF13BE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
44 | 668474111841BE3500EF13BE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
45 | 668474131841BE3500EF13BE /* HUChartDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HUChartDemo-Prefix.pch"; sourceTree = ""; };
46 | 668474141841BE3500EF13BE /* HUAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HUAppDelegate.h; sourceTree = ""; };
47 | 668474151841BE3500EF13BE /* HUAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HUAppDelegate.m; sourceTree = ""; };
48 | 668474171841BE3500EF13BE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
49 | 6684741D1841BE3500EF13BE /* HUChartDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HUChartDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 6684741E1841BE3500EF13BE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
51 | 668474261841BE3500EF13BE /* HUChartDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HUChartDemoTests-Info.plist"; sourceTree = ""; };
52 | 668474281841BE3500EF13BE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
53 | 6684742A1841BE3500EF13BE /* HUChartDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HUChartDemoTests.m; sourceTree = ""; };
54 | 668474351841BE9100EF13BE /* HUChartEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HUChartEntry.h; path = HUChart/HUChartEntry.h; sourceTree = ""; };
55 | 668474361841BE9100EF13BE /* HUChartEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HUChartEntry.m; path = HUChart/HUChartEntry.m; sourceTree = ""; };
56 | 668474371841BE9100EF13BE /* HUSemiCircleChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HUSemiCircleChart.h; path = HUChart/HUSemiCircleChart.h; sourceTree = ""; };
57 | 668474381841BE9100EF13BE /* HUSemiCircleChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HUSemiCircleChart.m; path = HUChart/HUSemiCircleChart.m; sourceTree = ""; };
58 | 6684743B1841BEC600EF13BE /* HUViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HUViewController.h; sourceTree = ""; };
59 | 6684743C1841BEC600EF13BE /* HUViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HUViewController.m; sourceTree = ""; };
60 | /* End PBXFileReference section */
61 |
62 | /* Begin PBXFrameworksBuildPhase section */
63 | 668473FF1841BE3500EF13BE /* Frameworks */ = {
64 | isa = PBXFrameworksBuildPhase;
65 | buildActionMask = 2147483647;
66 | files = (
67 | 668474081841BE3500EF13BE /* CoreGraphics.framework in Frameworks */,
68 | 6684740A1841BE3500EF13BE /* UIKit.framework in Frameworks */,
69 | 668474061841BE3500EF13BE /* Foundation.framework in Frameworks */,
70 | );
71 | runOnlyForDeploymentPostprocessing = 0;
72 | };
73 | 6684741A1841BE3500EF13BE /* Frameworks */ = {
74 | isa = PBXFrameworksBuildPhase;
75 | buildActionMask = 2147483647;
76 | files = (
77 | 6684741F1841BE3500EF13BE /* XCTest.framework in Frameworks */,
78 | 668474211841BE3500EF13BE /* UIKit.framework in Frameworks */,
79 | 668474201841BE3500EF13BE /* Foundation.framework in Frameworks */,
80 | );
81 | runOnlyForDeploymentPostprocessing = 0;
82 | };
83 | /* End PBXFrameworksBuildPhase section */
84 |
85 | /* Begin PBXGroup section */
86 | 668473F91841BE3400EF13BE = {
87 | isa = PBXGroup;
88 | children = (
89 | 668474341841BE5200EF13BE /* HUChart */,
90 | 6684740B1841BE3500EF13BE /* HUChartDemo */,
91 | 668474241841BE3500EF13BE /* HUChartDemoTests */,
92 | 668474041841BE3500EF13BE /* Frameworks */,
93 | 668474031841BE3500EF13BE /* Products */,
94 | );
95 | sourceTree = "";
96 | };
97 | 668474031841BE3500EF13BE /* Products */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 668474021841BE3500EF13BE /* HUChartDemo.app */,
101 | 6684741D1841BE3500EF13BE /* HUChartDemoTests.xctest */,
102 | );
103 | name = Products;
104 | sourceTree = "";
105 | };
106 | 668474041841BE3500EF13BE /* Frameworks */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 668474051841BE3500EF13BE /* Foundation.framework */,
110 | 668474071841BE3500EF13BE /* CoreGraphics.framework */,
111 | 668474091841BE3500EF13BE /* UIKit.framework */,
112 | 6684741E1841BE3500EF13BE /* XCTest.framework */,
113 | );
114 | name = Frameworks;
115 | sourceTree = "";
116 | };
117 | 6684740B1841BE3500EF13BE /* HUChartDemo */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 6684743B1841BEC600EF13BE /* HUViewController.h */,
121 | 6684743C1841BEC600EF13BE /* HUViewController.m */,
122 | 668474141841BE3500EF13BE /* HUAppDelegate.h */,
123 | 668474151841BE3500EF13BE /* HUAppDelegate.m */,
124 | 668474171841BE3500EF13BE /* Images.xcassets */,
125 | 6684740C1841BE3500EF13BE /* Supporting Files */,
126 | );
127 | path = HUChartDemo;
128 | sourceTree = "";
129 | };
130 | 6684740C1841BE3500EF13BE /* Supporting Files */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 6684740D1841BE3500EF13BE /* HUChartDemo-Info.plist */,
134 | 6684740E1841BE3500EF13BE /* InfoPlist.strings */,
135 | 668474111841BE3500EF13BE /* main.m */,
136 | 668474131841BE3500EF13BE /* HUChartDemo-Prefix.pch */,
137 | );
138 | name = "Supporting Files";
139 | sourceTree = "";
140 | };
141 | 668474241841BE3500EF13BE /* HUChartDemoTests */ = {
142 | isa = PBXGroup;
143 | children = (
144 | 6684742A1841BE3500EF13BE /* HUChartDemoTests.m */,
145 | 668474251841BE3500EF13BE /* Supporting Files */,
146 | );
147 | path = HUChartDemoTests;
148 | sourceTree = "";
149 | };
150 | 668474251841BE3500EF13BE /* Supporting Files */ = {
151 | isa = PBXGroup;
152 | children = (
153 | 668474261841BE3500EF13BE /* HUChartDemoTests-Info.plist */,
154 | 668474271841BE3500EF13BE /* InfoPlist.strings */,
155 | );
156 | name = "Supporting Files";
157 | sourceTree = "";
158 | };
159 | 668474341841BE5200EF13BE /* HUChart */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 668474351841BE9100EF13BE /* HUChartEntry.h */,
163 | 668474361841BE9100EF13BE /* HUChartEntry.m */,
164 | 668474371841BE9100EF13BE /* HUSemiCircleChart.h */,
165 | 668474381841BE9100EF13BE /* HUSemiCircleChart.m */,
166 | );
167 | name = HUChart;
168 | sourceTree = "";
169 | };
170 | /* End PBXGroup section */
171 |
172 | /* Begin PBXNativeTarget section */
173 | 668474011841BE3500EF13BE /* HUChartDemo */ = {
174 | isa = PBXNativeTarget;
175 | buildConfigurationList = 6684742E1841BE3500EF13BE /* Build configuration list for PBXNativeTarget "HUChartDemo" */;
176 | buildPhases = (
177 | 668473FE1841BE3500EF13BE /* Sources */,
178 | 668473FF1841BE3500EF13BE /* Frameworks */,
179 | 668474001841BE3500EF13BE /* Resources */,
180 | );
181 | buildRules = (
182 | );
183 | dependencies = (
184 | );
185 | name = HUChartDemo;
186 | productName = HUChartDemo;
187 | productReference = 668474021841BE3500EF13BE /* HUChartDemo.app */;
188 | productType = "com.apple.product-type.application";
189 | };
190 | 6684741C1841BE3500EF13BE /* HUChartDemoTests */ = {
191 | isa = PBXNativeTarget;
192 | buildConfigurationList = 668474311841BE3500EF13BE /* Build configuration list for PBXNativeTarget "HUChartDemoTests" */;
193 | buildPhases = (
194 | 668474191841BE3500EF13BE /* Sources */,
195 | 6684741A1841BE3500EF13BE /* Frameworks */,
196 | 6684741B1841BE3500EF13BE /* Resources */,
197 | );
198 | buildRules = (
199 | );
200 | dependencies = (
201 | 668474231841BE3500EF13BE /* PBXTargetDependency */,
202 | );
203 | name = HUChartDemoTests;
204 | productName = HUChartDemoTests;
205 | productReference = 6684741D1841BE3500EF13BE /* HUChartDemoTests.xctest */;
206 | productType = "com.apple.product-type.bundle.unit-test";
207 | };
208 | /* End PBXNativeTarget section */
209 |
210 | /* Begin PBXProject section */
211 | 668473FA1841BE3500EF13BE /* Project object */ = {
212 | isa = PBXProject;
213 | attributes = {
214 | CLASSPREFIX = HU;
215 | LastUpgradeCheck = 0500;
216 | ORGANIZATIONNAME = AugoLab;
217 | TargetAttributes = {
218 | 6684741C1841BE3500EF13BE = {
219 | TestTargetID = 668474011841BE3500EF13BE;
220 | };
221 | };
222 | };
223 | buildConfigurationList = 668473FD1841BE3500EF13BE /* Build configuration list for PBXProject "HUChartDemo" */;
224 | compatibilityVersion = "Xcode 3.2";
225 | developmentRegion = English;
226 | hasScannedForEncodings = 0;
227 | knownRegions = (
228 | en,
229 | );
230 | mainGroup = 668473F91841BE3400EF13BE;
231 | productRefGroup = 668474031841BE3500EF13BE /* Products */;
232 | projectDirPath = "";
233 | projectRoot = "";
234 | targets = (
235 | 668474011841BE3500EF13BE /* HUChartDemo */,
236 | 6684741C1841BE3500EF13BE /* HUChartDemoTests */,
237 | );
238 | };
239 | /* End PBXProject section */
240 |
241 | /* Begin PBXResourcesBuildPhase section */
242 | 668474001841BE3500EF13BE /* Resources */ = {
243 | isa = PBXResourcesBuildPhase;
244 | buildActionMask = 2147483647;
245 | files = (
246 | 668474101841BE3500EF13BE /* InfoPlist.strings in Resources */,
247 | 668474181841BE3500EF13BE /* Images.xcassets in Resources */,
248 | );
249 | runOnlyForDeploymentPostprocessing = 0;
250 | };
251 | 6684741B1841BE3500EF13BE /* Resources */ = {
252 | isa = PBXResourcesBuildPhase;
253 | buildActionMask = 2147483647;
254 | files = (
255 | 668474291841BE3500EF13BE /* InfoPlist.strings in Resources */,
256 | );
257 | runOnlyForDeploymentPostprocessing = 0;
258 | };
259 | /* End PBXResourcesBuildPhase section */
260 |
261 | /* Begin PBXSourcesBuildPhase section */
262 | 668473FE1841BE3500EF13BE /* Sources */ = {
263 | isa = PBXSourcesBuildPhase;
264 | buildActionMask = 2147483647;
265 | files = (
266 | 6684743D1841BEC600EF13BE /* HUViewController.m in Sources */,
267 | 668474121841BE3500EF13BE /* main.m in Sources */,
268 | 6684743A1841BE9100EF13BE /* HUSemiCircleChart.m in Sources */,
269 | 668474161841BE3500EF13BE /* HUAppDelegate.m in Sources */,
270 | 668474391841BE9100EF13BE /* HUChartEntry.m in Sources */,
271 | );
272 | runOnlyForDeploymentPostprocessing = 0;
273 | };
274 | 668474191841BE3500EF13BE /* Sources */ = {
275 | isa = PBXSourcesBuildPhase;
276 | buildActionMask = 2147483647;
277 | files = (
278 | 6684742B1841BE3500EF13BE /* HUChartDemoTests.m in Sources */,
279 | );
280 | runOnlyForDeploymentPostprocessing = 0;
281 | };
282 | /* End PBXSourcesBuildPhase section */
283 |
284 | /* Begin PBXTargetDependency section */
285 | 668474231841BE3500EF13BE /* PBXTargetDependency */ = {
286 | isa = PBXTargetDependency;
287 | target = 668474011841BE3500EF13BE /* HUChartDemo */;
288 | targetProxy = 668474221841BE3500EF13BE /* PBXContainerItemProxy */;
289 | };
290 | /* End PBXTargetDependency section */
291 |
292 | /* Begin PBXVariantGroup section */
293 | 6684740E1841BE3500EF13BE /* InfoPlist.strings */ = {
294 | isa = PBXVariantGroup;
295 | children = (
296 | 6684740F1841BE3500EF13BE /* en */,
297 | );
298 | name = InfoPlist.strings;
299 | sourceTree = "";
300 | };
301 | 668474271841BE3500EF13BE /* InfoPlist.strings */ = {
302 | isa = PBXVariantGroup;
303 | children = (
304 | 668474281841BE3500EF13BE /* en */,
305 | );
306 | name = InfoPlist.strings;
307 | sourceTree = "";
308 | };
309 | /* End PBXVariantGroup section */
310 |
311 | /* Begin XCBuildConfiguration section */
312 | 6684742C1841BE3500EF13BE /* Debug */ = {
313 | isa = XCBuildConfiguration;
314 | buildSettings = {
315 | ALWAYS_SEARCH_USER_PATHS = NO;
316 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
318 | CLANG_CXX_LIBRARY = "libc++";
319 | CLANG_ENABLE_MODULES = YES;
320 | CLANG_ENABLE_OBJC_ARC = YES;
321 | CLANG_WARN_BOOL_CONVERSION = YES;
322 | CLANG_WARN_CONSTANT_CONVERSION = YES;
323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
324 | CLANG_WARN_EMPTY_BODY = YES;
325 | CLANG_WARN_ENUM_CONVERSION = YES;
326 | CLANG_WARN_INT_CONVERSION = YES;
327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
328 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
329 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
330 | COPY_PHASE_STRIP = NO;
331 | GCC_C_LANGUAGE_STANDARD = gnu99;
332 | GCC_DYNAMIC_NO_PIC = NO;
333 | GCC_OPTIMIZATION_LEVEL = 0;
334 | GCC_PREPROCESSOR_DEFINITIONS = (
335 | "DEBUG=1",
336 | "$(inherited)",
337 | );
338 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
341 | GCC_WARN_UNDECLARED_SELECTOR = YES;
342 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
343 | GCC_WARN_UNUSED_FUNCTION = YES;
344 | GCC_WARN_UNUSED_VARIABLE = YES;
345 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
346 | ONLY_ACTIVE_ARCH = YES;
347 | SDKROOT = iphoneos;
348 | TARGETED_DEVICE_FAMILY = "1,2";
349 | };
350 | name = Debug;
351 | };
352 | 6684742D1841BE3500EF13BE /* Release */ = {
353 | isa = XCBuildConfiguration;
354 | buildSettings = {
355 | ALWAYS_SEARCH_USER_PATHS = NO;
356 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
357 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
358 | CLANG_CXX_LIBRARY = "libc++";
359 | CLANG_ENABLE_MODULES = YES;
360 | CLANG_ENABLE_OBJC_ARC = YES;
361 | CLANG_WARN_BOOL_CONVERSION = YES;
362 | CLANG_WARN_CONSTANT_CONVERSION = YES;
363 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
364 | CLANG_WARN_EMPTY_BODY = YES;
365 | CLANG_WARN_ENUM_CONVERSION = YES;
366 | CLANG_WARN_INT_CONVERSION = YES;
367 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
368 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
369 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
370 | COPY_PHASE_STRIP = YES;
371 | ENABLE_NS_ASSERTIONS = NO;
372 | GCC_C_LANGUAGE_STANDARD = gnu99;
373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
375 | GCC_WARN_UNDECLARED_SELECTOR = YES;
376 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
377 | GCC_WARN_UNUSED_FUNCTION = YES;
378 | GCC_WARN_UNUSED_VARIABLE = YES;
379 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
380 | SDKROOT = iphoneos;
381 | TARGETED_DEVICE_FAMILY = "1,2";
382 | VALIDATE_PRODUCT = YES;
383 | };
384 | name = Release;
385 | };
386 | 6684742F1841BE3500EF13BE /* Debug */ = {
387 | isa = XCBuildConfiguration;
388 | buildSettings = {
389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
390 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
391 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
392 | GCC_PREFIX_HEADER = "HUChartDemo/HUChartDemo-Prefix.pch";
393 | INFOPLIST_FILE = "HUChartDemo/HUChartDemo-Info.plist";
394 | IPHONEOS_DEPLOYMENT_TARGET = 6.1;
395 | PRODUCT_NAME = "$(TARGET_NAME)";
396 | WRAPPER_EXTENSION = app;
397 | };
398 | name = Debug;
399 | };
400 | 668474301841BE3500EF13BE /* Release */ = {
401 | isa = XCBuildConfiguration;
402 | buildSettings = {
403 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
404 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
405 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
406 | GCC_PREFIX_HEADER = "HUChartDemo/HUChartDemo-Prefix.pch";
407 | INFOPLIST_FILE = "HUChartDemo/HUChartDemo-Info.plist";
408 | IPHONEOS_DEPLOYMENT_TARGET = 6.1;
409 | PRODUCT_NAME = "$(TARGET_NAME)";
410 | WRAPPER_EXTENSION = app;
411 | };
412 | name = Release;
413 | };
414 | 668474321841BE3500EF13BE /* Debug */ = {
415 | isa = XCBuildConfiguration;
416 | buildSettings = {
417 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
418 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/HUChartDemo.app/HUChartDemo";
419 | FRAMEWORK_SEARCH_PATHS = (
420 | "$(SDKROOT)/Developer/Library/Frameworks",
421 | "$(inherited)",
422 | "$(DEVELOPER_FRAMEWORKS_DIR)",
423 | );
424 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
425 | GCC_PREFIX_HEADER = "HUChartDemo/HUChartDemo-Prefix.pch";
426 | GCC_PREPROCESSOR_DEFINITIONS = (
427 | "DEBUG=1",
428 | "$(inherited)",
429 | );
430 | INFOPLIST_FILE = "HUChartDemoTests/HUChartDemoTests-Info.plist";
431 | PRODUCT_NAME = "$(TARGET_NAME)";
432 | TEST_HOST = "$(BUNDLE_LOADER)";
433 | WRAPPER_EXTENSION = xctest;
434 | };
435 | name = Debug;
436 | };
437 | 668474331841BE3500EF13BE /* Release */ = {
438 | isa = XCBuildConfiguration;
439 | buildSettings = {
440 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
441 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/HUChartDemo.app/HUChartDemo";
442 | FRAMEWORK_SEARCH_PATHS = (
443 | "$(SDKROOT)/Developer/Library/Frameworks",
444 | "$(inherited)",
445 | "$(DEVELOPER_FRAMEWORKS_DIR)",
446 | );
447 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
448 | GCC_PREFIX_HEADER = "HUChartDemo/HUChartDemo-Prefix.pch";
449 | INFOPLIST_FILE = "HUChartDemoTests/HUChartDemoTests-Info.plist";
450 | PRODUCT_NAME = "$(TARGET_NAME)";
451 | TEST_HOST = "$(BUNDLE_LOADER)";
452 | WRAPPER_EXTENSION = xctest;
453 | };
454 | name = Release;
455 | };
456 | /* End XCBuildConfiguration section */
457 |
458 | /* Begin XCConfigurationList section */
459 | 668473FD1841BE3500EF13BE /* Build configuration list for PBXProject "HUChartDemo" */ = {
460 | isa = XCConfigurationList;
461 | buildConfigurations = (
462 | 6684742C1841BE3500EF13BE /* Debug */,
463 | 6684742D1841BE3500EF13BE /* Release */,
464 | );
465 | defaultConfigurationIsVisible = 0;
466 | defaultConfigurationName = Release;
467 | };
468 | 6684742E1841BE3500EF13BE /* Build configuration list for PBXNativeTarget "HUChartDemo" */ = {
469 | isa = XCConfigurationList;
470 | buildConfigurations = (
471 | 6684742F1841BE3500EF13BE /* Debug */,
472 | 668474301841BE3500EF13BE /* Release */,
473 | );
474 | defaultConfigurationIsVisible = 0;
475 | };
476 | 668474311841BE3500EF13BE /* Build configuration list for PBXNativeTarget "HUChartDemoTests" */ = {
477 | isa = XCConfigurationList;
478 | buildConfigurations = (
479 | 668474321841BE3500EF13BE /* Debug */,
480 | 668474331841BE3500EF13BE /* Release */,
481 | );
482 | defaultConfigurationIsVisible = 0;
483 | };
484 | /* End XCConfigurationList section */
485 | };
486 | rootObject = 668473FA1841BE3500EF13BE /* Project object */;
487 | }
488 |
--------------------------------------------------------------------------------