kevinzhow

Merge branch 'jerrygdm-multiple-selection'

@@ -55,6 +55,9 @@ @@ -55,6 +55,9 @@
55 /** Update chart items. Does not update chart itself. */ 55 /** Update chart items. Does not update chart itself. */
56 - (void)updateChartData:(NSArray *)data; 56 - (void)updateChartData:(NSArray *)data;
57 57
  58 +/** Multiple selection */
  59 +@property (nonatomic, assign) BOOL enableMultipleSelection;
  60 +
58 - (void)strokeChart; 61 - (void)strokeChart;
59 62
60 - (void)recompute; 63 - (void)recompute;
@@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
20 @property (nonatomic) NSMutableArray *descriptionLabels; 20 @property (nonatomic) NSMutableArray *descriptionLabels;
21 @property (strong, nonatomic) CAShapeLayer *sectorHighlight; 21 @property (strong, nonatomic) CAShapeLayer *sectorHighlight;
22 22
  23 +@property (nonatomic, strong) NSMutableDictionary *selectedItems;
  24 +
23 - (void)loadDefault; 25 - (void)loadDefault;
24 26
25 - (UILabel *)descriptionLabelForItemAtIndex:(NSUInteger)index; 27 - (UILabel *)descriptionLabelForItemAtIndex:(NSUInteger)index;
@@ -45,12 +47,16 @@ @@ -45,12 +47,16 @@
45 self = [self initWithFrame:frame]; 47 self = [self initWithFrame:frame];
46 if(self){ 48 if(self){
47 _items = [NSArray arrayWithArray:items]; 49 _items = [NSArray arrayWithArray:items];
  50 + _selectedItems = [NSMutableDictionary dictionary];
  51 + _outerCircleRadius = CGRectGetWidth(self.bounds) / 2;
  52 + _innerCircleRadius = CGRectGetWidth(self.bounds) / 6;
48 _descriptionTextColor = [UIColor whiteColor]; 53 _descriptionTextColor = [UIColor whiteColor];
49 _descriptionTextFont = [UIFont fontWithName:@"Avenir-Medium" size:18.0]; 54 _descriptionTextFont = [UIFont fontWithName:@"Avenir-Medium" size:18.0];
50 _descriptionTextShadowColor = [[UIColor blackColor] colorWithAlphaComponent:0.4]; 55 _descriptionTextShadowColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
51 _descriptionTextShadowOffset = CGSizeMake(0, 1); 56 _descriptionTextShadowOffset = CGSizeMake(0, 1);
52 _duration = 1.0; 57 _duration = 1.0;
53 _shouldHighlightSectorOnTouch = YES; 58 _shouldHighlightSectorOnTouch = YES;
  59 + _enableMultipleSelection = NO;
54 60
55 [super setupDefaultValues]; 61 [super setupDefaultValues];
56 [self loadDefault]; 62 [self loadDefault];
@@ -290,9 +296,11 @@ @@ -290,9 +296,11 @@
290 [self.delegate userClickedOnPieIndexItem:index]; 296 [self.delegate userClickedOnPieIndexItem:index];
291 } 297 }
292 298
293 - if (self.shouldHighlightSectorOnTouch) { 299 + if (self.shouldHighlightSectorOnTouch)
294 - 300 + {
295 - if (self.sectorHighlight) { 301 + if (!self.enableMultipleSelection)
  302 + {
  303 + if (self.sectorHighlight)
296 [self.sectorHighlight removeFromSuperlayer]; 304 [self.sectorHighlight removeFromSuperlayer];
297 } 305 }
298 306
@@ -306,14 +314,34 @@ @@ -306,14 +314,34 @@
306 314
307 CGFloat startPercnetage = [self startPercentageForItemAtIndex:index]; 315 CGFloat startPercnetage = [self startPercentageForItemAtIndex:index];
308 CGFloat endPercentage = [self endPercentageForItemAtIndex:index]; 316 CGFloat endPercentage = [self endPercentageForItemAtIndex:index];
  317 +
309 self.sectorHighlight = [self newCircleLayerWithRadius:_outerCircleRadius + 5 318 self.sectorHighlight = [self newCircleLayerWithRadius:_outerCircleRadius + 5
310 borderWidth:10 319 borderWidth:10
311 fillColor:[UIColor clearColor] 320 fillColor:[UIColor clearColor]
312 borderColor:newColor 321 borderColor:newColor
313 startPercentage:startPercnetage 322 startPercentage:startPercnetage
314 endPercentage:endPercentage]; 323 endPercentage:endPercentage];
  324 +
  325 + if (self.enableMultipleSelection)
  326 + {
  327 + NSString *dictIndex = [NSString stringWithFormat:@"%d", index];
  328 + CAShapeLayer *indexShape = [self.selectedItems valueForKey:dictIndex];
  329 + if (indexShape)
  330 + {
  331 + [indexShape removeFromSuperlayer];
  332 + [self.selectedItems removeObjectForKey:dictIndex];
  333 + }
  334 + else
  335 + {
  336 + [self.selectedItems setObject:self.sectorHighlight forKey:dictIndex];
315 [_contentView.layer addSublayer:self.sectorHighlight]; 337 [_contentView.layer addSublayer:self.sectorHighlight];
316 } 338 }
  339 + }
  340 + else
  341 + {
  342 + [_contentView.layer addSublayer:self.sectorHighlight];
  343 + }
  344 + }
317 } 345 }
318 346
319 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 347 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
1 -<?xml version='1.0' encoding='UTF-8'?><Workspace version='1.0'><FileRef location='group:PNChartDemo.xcodeproj'/><FileRef location='group:Pods/Pods.xcodeproj'/></Workspace> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<Workspace
  3 + version = "1.0">
  4 + <FileRef
  5 + location = "group:PNChartDemo.xcodeproj">
  6 + </FileRef>
  7 + <FileRef
  8 + location = "group:Pods/Pods.xcodeproj">
  9 + </FileRef>
  10 +</Workspace>
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="9Rt-UT-IxH"> 2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="9Rt-UT-IxH">
3 <dependencies> 3 <dependencies>
4 <deployment identifier="iOS"/> 4 <deployment identifier="iOS"/>
5 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/> 5 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
6 </dependencies> 6 </dependencies>
7 <scenes> 7 <scenes>
8 <!--PNChart--> 8 <!--PNChart-->
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FUU-vZ-jMd"> 29 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FUU-vZ-jMd">
30 <rect key="frame" x="53" y="81" width="215" height="30"/> 30 <rect key="frame" x="53" y="81" width="215" height="30"/>
31 <fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="23"/> 31 <fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="23"/>
32 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 32 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
33 <nil key="highlightedColor"/> 33 <nil key="highlightedColor"/>
34 </label> 34 </label>
35 <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ORA-mb-hJl"> 35 <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ORA-mb-hJl">
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 <action selector="leftSwitchChanged:" destination="Tha-Wr-sPW" eventType="valueChanged" id="q9T-QK-Sas"/> 38 <action selector="leftSwitchChanged:" destination="Tha-Wr-sPW" eventType="valueChanged" id="q9T-QK-Sas"/>
39 </connections> 39 </connections>
40 </switch> 40 </switch>
41 - <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qR7-40-7ir"> 41 + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qR7-40-7ir">
42 <rect key="frame" x="261" y="489" width="51" height="31"/> 42 <rect key="frame" x="261" y="489" width="51" height="31"/>
43 <connections> 43 <connections>
44 <action selector="rightSwitchChanged:" destination="Tha-Wr-sPW" eventType="valueChanged" id="n6V-lL-r8Q"/> 44 <action selector="rightSwitchChanged:" destination="Tha-Wr-sPW" eventType="valueChanged" id="n6V-lL-r8Q"/>
@@ -47,26 +47,43 @@ @@ -47,26 +47,43 @@
47 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Percentage" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IKu-qh-ksi"> 47 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Percentage" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IKu-qh-ksi">
48 <rect key="frame" x="16" y="528" width="121" height="21"/> 48 <rect key="frame" x="16" y="528" width="121" height="21"/>
49 <fontDescription key="fontDescription" type="system" pointSize="17"/> 49 <fontDescription key="fontDescription" type="system" pointSize="17"/>
50 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 50 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
51 <nil key="highlightedColor"/> 51 <nil key="highlightedColor"/>
52 </label> 52 </label>
53 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Show Labels" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ifm-a9-Wkq"> 53 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Show Labels" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ifm-a9-Wkq">
54 <rect key="frame" x="192" y="527" width="118" height="21"/> 54 <rect key="frame" x="192" y="527" width="118" height="21"/>
55 <fontDescription key="fontDescription" type="system" pointSize="17"/> 55 <fontDescription key="fontDescription" type="system" pointSize="17"/>
56 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 56 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
  57 + <nil key="highlightedColor"/>
  58 + </label>
  59 + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="kav-3r-blI">
  60 + <rect key="frame" x="142" y="461" width="51" height="31"/>
  61 + <connections>
  62 + <action selector="centerSwitchChanged:" destination="Tha-Wr-sPW" eventType="valueChanged" id="ETI-hb-d8F"/>
  63 + <action selector="rightSwitchChanged:" destination="Tha-Wr-sPW" eventType="valueChanged" id="2Rs-PH-2WM"/>
  64 + </connections>
  65 + </switch>
  66 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Multiple Selection" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sMF-o9-dZX">
  67 + <rect key="frame" x="73" y="499" width="137" height="21"/>
  68 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
  69 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
57 <nil key="highlightedColor"/> 70 <nil key="highlightedColor"/>
58 </label> 71 </label>
59 </subviews> 72 </subviews>
60 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> 73 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
61 <constraints> 74 <constraints>
  75 + <constraint firstItem="qR7-40-7ir" firstAttribute="top" secondItem="kav-3r-blI" secondAttribute="bottom" constant="10" id="4Qo-Xx-bbF"/>
62 <constraint firstItem="FUU-vZ-jMd" firstAttribute="top" secondItem="znr-YO-4a4" secondAttribute="bottom" constant="17" id="DLv-qJ-h7R"/> 76 <constraint firstItem="FUU-vZ-jMd" firstAttribute="top" secondItem="znr-YO-4a4" secondAttribute="bottom" constant="17" id="DLv-qJ-h7R"/>
63 <constraint firstAttribute="centerX" secondItem="FUU-vZ-jMd" secondAttribute="centerX" id="YGT-a5-Zka"/> 77 <constraint firstAttribute="centerX" secondItem="FUU-vZ-jMd" secondAttribute="centerX" id="YGT-a5-Zka"/>
  78 + <constraint firstItem="kav-3r-blI" firstAttribute="centerX" secondItem="sMF-o9-dZX" secondAttribute="centerX" id="aUL-sS-9ZE"/>
  79 + <constraint firstAttribute="centerX" secondItem="kav-3r-blI" secondAttribute="centerX" id="aap-Gv-rtz"/>
64 <constraint firstItem="L3F-13-Wf5" firstAttribute="top" secondItem="znr-YO-4a4" secondAttribute="bottom" constant="300" id="ewm-kv-p8k"/> 80 <constraint firstItem="L3F-13-Wf5" firstAttribute="top" secondItem="znr-YO-4a4" secondAttribute="bottom" constant="300" id="ewm-kv-p8k"/>
65 <constraint firstAttribute="centerX" secondItem="L3F-13-Wf5" secondAttribute="centerX" id="zXw-WV-mro"/> 81 <constraint firstAttribute="centerX" secondItem="L3F-13-Wf5" secondAttribute="centerX" id="zXw-WV-mro"/>
66 </constraints> 82 </constraints>
67 </view> 83 </view>
68 <navigationItem key="navigationItem" title="PNChart" id="Ukg-Sg-E2z"/> 84 <navigationItem key="navigationItem" title="PNChart" id="Ukg-Sg-E2z"/>
69 <connections> 85 <connections>
  86 + <outlet property="centerSwitch" destination="kav-3r-blI" id="aDA-mR-FhR"/>
70 <outlet property="changeValueButton" destination="L3F-13-Wf5" id="JnI-y3-Xpj"/> 87 <outlet property="changeValueButton" destination="L3F-13-Wf5" id="JnI-y3-Xpj"/>
71 <outlet property="leftLabel" destination="IKu-qh-ksi" id="CPy-oy-qCP"/> 88 <outlet property="leftLabel" destination="IKu-qh-ksi" id="CPy-oy-qCP"/>
72 <outlet property="leftSwitch" destination="ORA-mb-hJl" id="u1M-2f-6P1"/> 89 <outlet property="leftSwitch" destination="ORA-mb-hJl" id="u1M-2f-6P1"/>
@@ -101,7 +118,7 @@ @@ -101,7 +118,7 @@
101 <rect key="frame" x="15" y="0.0" width="270" height="43"/> 118 <rect key="frame" x="15" y="0.0" width="270" height="43"/>
102 <autoresizingMask key="autoresizingMask"/> 119 <autoresizingMask key="autoresizingMask"/>
103 <fontDescription key="fontDescription" type="system" pointSize="18"/> 120 <fontDescription key="fontDescription" type="system" pointSize="18"/>
104 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 121 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
105 <nil key="highlightedColor"/> 122 <nil key="highlightedColor"/>
106 </label> 123 </label>
107 </subviews> 124 </subviews>
@@ -121,7 +138,7 @@ @@ -121,7 +138,7 @@
121 <rect key="frame" x="15" y="0.0" width="270" height="43"/> 138 <rect key="frame" x="15" y="0.0" width="270" height="43"/>
122 <autoresizingMask key="autoresizingMask"/> 139 <autoresizingMask key="autoresizingMask"/>
123 <fontDescription key="fontDescription" type="system" pointSize="18"/> 140 <fontDescription key="fontDescription" type="system" pointSize="18"/>
124 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 141 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
125 <nil key="highlightedColor"/> 142 <nil key="highlightedColor"/>
126 </label> 143 </label>
127 </subviews> 144 </subviews>
@@ -141,7 +158,7 @@ @@ -141,7 +158,7 @@
141 <rect key="frame" x="15" y="0.0" width="270" height="43"/> 158 <rect key="frame" x="15" y="0.0" width="270" height="43"/>
142 <autoresizingMask key="autoresizingMask"/> 159 <autoresizingMask key="autoresizingMask"/>
143 <fontDescription key="fontDescription" type="system" pointSize="18"/> 160 <fontDescription key="fontDescription" type="system" pointSize="18"/>
144 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 161 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
145 <nil key="highlightedColor"/> 162 <nil key="highlightedColor"/>
146 </label> 163 </label>
147 </subviews> 164 </subviews>
@@ -161,7 +178,7 @@ @@ -161,7 +178,7 @@
161 <rect key="frame" x="15" y="0.0" width="270" height="43"/> 178 <rect key="frame" x="15" y="0.0" width="270" height="43"/>
162 <autoresizingMask key="autoresizingMask"/> 179 <autoresizingMask key="autoresizingMask"/>
163 <fontDescription key="fontDescription" type="system" pointSize="18"/> 180 <fontDescription key="fontDescription" type="system" pointSize="18"/>
164 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 181 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
165 <nil key="highlightedColor"/> 182 <nil key="highlightedColor"/>
166 </label> 183 </label>
167 </subviews> 184 </subviews>
@@ -179,7 +196,7 @@ @@ -179,7 +196,7 @@
179 <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="ScatterChart" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="YOU-SK-mQU"> 196 <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="ScatterChart" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="YOU-SK-mQU">
180 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 197 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
181 <fontDescription key="fontDescription" type="system" pointSize="18"/> 198 <fontDescription key="fontDescription" type="system" pointSize="18"/>
182 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 199 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
183 <nil key="highlightedColor"/> 200 <nil key="highlightedColor"/>
184 </label> 201 </label>
185 </subviews> 202 </subviews>
@@ -199,7 +216,7 @@ @@ -199,7 +216,7 @@
199 <rect key="frame" x="15" y="0.0" width="270" height="43"/> 216 <rect key="frame" x="15" y="0.0" width="270" height="43"/>
200 <autoresizingMask key="autoresizingMask"/> 217 <autoresizingMask key="autoresizingMask"/>
201 <fontDescription key="fontDescription" type="system" pointSize="18"/> 218 <fontDescription key="fontDescription" type="system" pointSize="18"/>
202 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 219 + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
203 <nil key="highlightedColor"/> 220 <nil key="highlightedColor"/>
204 </label> 221 </label>
205 </subviews> 222 </subviews>
@@ -25,12 +25,13 @@ @@ -25,12 +25,13 @@
25 @property (weak, nonatomic) IBOutlet UIButton *changeValueButton; 25 @property (weak, nonatomic) IBOutlet UIButton *changeValueButton;
26 26
27 @property (weak, nonatomic) IBOutlet UISwitch *leftSwitch; 27 @property (weak, nonatomic) IBOutlet UISwitch *leftSwitch;
  28 +@property (weak, nonatomic) IBOutlet UISwitch *centerSwitch;
28 @property (weak, nonatomic) IBOutlet UISwitch *rightSwitch; 29 @property (weak, nonatomic) IBOutlet UISwitch *rightSwitch;
29 @property (weak, nonatomic) IBOutlet UILabel *leftLabel; 30 @property (weak, nonatomic) IBOutlet UILabel *leftLabel;
30 @property (weak, nonatomic) IBOutlet UILabel *rightLabel; 31 @property (weak, nonatomic) IBOutlet UILabel *rightLabel;
31 32
32 - (IBAction)rightSwitchChanged:(id)sender; 33 - (IBAction)rightSwitchChanged:(id)sender;
33 - (IBAction)leftSwitchChanged:(id)sender; 34 - (IBAction)leftSwitchChanged:(id)sender;
34 - 35 +- (IBAction)rightSwitchChanged:(id)sender;
35 36
36 @end 37 @end
@@ -344,6 +344,15 @@ @@ -344,6 +344,15 @@
344 } 344 }
345 } 345 }
346 346
  347 +- (IBAction)centerSwitchChanged:(id)sender
  348 +{
  349 + if (self.pieChart)
  350 + {
  351 + [self.pieChart setEnableMultipleSelection:self.centerSwitch.on];
  352 + [self.pieChart strokeChart];
  353 + }
  354 +}
  355 +
347 - (IBAction)leftSwitchChanged:(id)sender { 356 - (IBAction)leftSwitchChanged:(id)sender {
348 if ([self.title isEqualToString:@"Pie Chart"]){ 357 if ([self.title isEqualToString:@"Pie Chart"]){
349 UISwitch *showRelative = (UISwitch*) sender; 358 UISwitch *showRelative = (UISwitch*) sender;
1 PODS: 1 PODS:
2 - - Expecta (0.4.2) 2 + - Expecta (1.0.2)
3 - UICountingLabel (1.2.0) 3 - UICountingLabel (1.2.0)
4 4
5 DEPENDENCIES: 5 DEPENDENCIES:
@@ -7,7 +7,7 @@ DEPENDENCIES: @@ -7,7 +7,7 @@ DEPENDENCIES:
7 - UICountingLabel (~> 1.2.0) 7 - UICountingLabel (~> 1.2.0)
8 8
9 SPEC CHECKSUMS: 9 SPEC CHECKSUMS:
10 - Expecta: 78b4e8b0c8291fa4524d7f74016b6065c2e391ec 10 + Expecta: 54e8a3530add08f4f0208c111355eda7cde74a53
11 UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa 11 UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa
12 12
13 -COCOAPODS: 0.38.2 13 +COCOAPODS: 0.35.0