added switch to show on demo the introduced new feature for multiple selection on pie chart
Showing
3 changed files
with
40 additions
and
13 deletions
| 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; |
-
Please register or login to post a comment