Skip to content

Commit

Permalink
Merge branch 'feature/dynamic_value_update' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzhow committed Dec 11, 2014
2 parents 0b050d8 + 9a31f53 commit 664b146
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion PNChart/PNCircleChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (id)initWithFrame:(CGRect)frame
CGFloat endAngle = clockwise ? -90.01f : 270.01f;

_lineWidth = @8.0f;
UIBezierPath *circlePath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.frame.size.width/2, self.frame.size.height/2)
UIBezierPath *circlePath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.center.x, self.center.y)
radius:(self.frame.size.height * 0.5) - [_lineWidth floatValue]
startAngle:DEGREES_TO_RADIANS(startAngle)
endAngle:DEGREES_TO_RADIANS(endAngle)
Expand Down
22 changes: 17 additions & 5 deletions PNChartDemo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="9Rt-UT-IxH">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="9Rt-UT-IxH">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
</dependencies>
<scenes>
<!--Chart View Controller - PNChart-->
<!--PNChart-->
<scene sceneID="lC9-iu-Smd">
<objects>
<viewController id="Tha-Wr-sPW" customClass="PCChartViewController" sceneMemberID="viewController">
Expand All @@ -16,15 +16,27 @@
<view key="view" contentMode="scaleToFill" id="PPb-b8-nBo">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="L3F-13-Wf5">
<rect key="frame" x="113" y="364" width="95" height="30"/>
<state key="normal" title="Change Value">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="L3F-13-Wf5" firstAttribute="top" secondItem="znr-YO-4a4" secondAttribute="bottom" constant="300" id="ewm-kv-p8k"/>
<constraint firstAttribute="centerX" secondItem="L3F-13-Wf5" secondAttribute="centerX" id="zXw-WV-mro"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="PNChart" id="Ukg-Sg-E2z"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kDa-u3-t6i" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="536" y="31"/>
</scene>
<!--Charts Table View Controller - PNChart-->
<!--PNChart-->
<scene sceneID="pBo-qW-N8B">
<objects>
<tableViewController id="cc5-BF-Ga2" customClass="PCChartsTableViewController" sceneMemberID="viewController">
Expand Down
4 changes: 2 additions & 2 deletions PNChartDemo/PCChartsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
[PNPieChartDataItem dataItemWithValue:40 color:PNDeepGreen description:@"GOOG I/O"],
];

PNPieChart *pieChart = [[PNPieChart alloc] initWithFrame:CGRectMake(40.0, 155.0, 240.0, 240.0) items:items];
PNPieChart *pieChart = [[PNPieChart alloc] initWithFrame:CGRectMake(SCREEN_WIDTH /2.0 - 100, 135, 200.0, 200.0) items:items];
pieChart.descriptionTextColor = [UIColor whiteColor];
pieChart.descriptionTextFont = [UIFont fontWithName:@"Avenir-Medium" size:14.0];
pieChart.descriptionTextFont = [UIFont fontWithName:@"Avenir-Medium" size:11.0];
pieChart.descriptionTextShadowColor = [UIColor clearColor];
[pieChart strokeChart];

Expand Down

0 comments on commit 664b146

Please sign in to comment.