diff --git a/ChartsDemo/ChartsDemo.xcodeproj/project.pbxproj b/ChartsDemo/ChartsDemo.xcodeproj/project.pbxproj index 4126859aa7..99edb3184e 100644 --- a/ChartsDemo/ChartsDemo.xcodeproj/project.pbxproj +++ b/ChartsDemo/ChartsDemo.xcodeproj/project.pbxproj @@ -11,11 +11,71 @@ 0471CBFC1CA1090A00E52DBC /* PiePolylineChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0471CBFB1CA1090A00E52DBC /* PiePolylineChartViewController.xib */; }; 0630AE511D81271B008859B0 /* Charts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0630AE411D8126C0008859B0 /* Charts.framework */; }; 0630AE521D81271B008859B0 /* Charts.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0630AE411D8126C0008859B0 /* Charts.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 225B36201F6EB9A50005B3D5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B361F1F6EB9A50005B3D5 /* AppDelegate.swift */; }; + 225B36311F6EB9EE0005B3D5 /* DemoBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B362F1F6EB9EE0005B3D5 /* DemoBaseViewController.swift */; }; + 225B36321F6EB9EE0005B3D5 /* DemoListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36301F6EB9EE0005B3D5 /* DemoListViewController.swift */; }; + 225B36381F6EBA040005B3D5 /* IntAxisValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36341F6EB9FE0005B3D5 /* IntAxisValueFormatter.swift */; }; + 225B36391F6EBA040005B3D5 /* DayAxisValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36351F6EB9FE0005B3D5 /* DayAxisValueFormatter.swift */; }; + 225B363A1F6EBA040005B3D5 /* DateValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36361F6EB9FE0005B3D5 /* DateValueFormatter.swift */; }; + 225B363B1F6EBA040005B3D5 /* LargeValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36371F6EB9FE0005B3D5 /* LargeValueFormatter.swift */; }; + 225B36401F6EBA1D0005B3D5 /* XYMarkerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B363D1F6EBA180005B3D5 /* XYMarkerView.swift */; }; + 225B36411F6EBA1D0005B3D5 /* BalloonMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B363E1F6EBA180005B3D5 /* BalloonMarker.swift */; }; + 225B36421F6EBA1D0005B3D5 /* RadarMarkerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B363F1F6EBA180005B3D5 /* RadarMarkerView.swift */; }; + 225B365B1F6EBA470005B3D5 /* MultipleLinesChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36441F6EBA410005B3D5 /* MultipleLinesChartViewController.swift */; }; + 225B365C1F6EBA470005B3D5 /* MultipleBarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36451F6EBA410005B3D5 /* MultipleBarChartViewController.swift */; }; + 225B365D1F6EBA470005B3D5 /* HalfPieChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36461F6EBA410005B3D5 /* HalfPieChartViewController.swift */; }; + 225B365E1F6EBA470005B3D5 /* LineChartTimeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36471F6EBA410005B3D5 /* LineChartTimeViewController.swift */; }; + 225B365F1F6EBA470005B3D5 /* ColoredLineChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36481F6EBA410005B3D5 /* ColoredLineChartViewController.swift */; }; + 225B36601F6EBA470005B3D5 /* LineChart2ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36491F6EBA410005B3D5 /* LineChart2ViewController.swift */; }; + 225B36611F6EBA470005B3D5 /* LineChart1ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B364A1F6EBA410005B3D5 /* LineChart1ViewController.swift */; }; + 225B36621F6EBA470005B3D5 /* NegativeStackedBarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B364B1F6EBA410005B3D5 /* NegativeStackedBarChartViewController.swift */; }; + 225B36631F6EBA470005B3D5 /* ScatterChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B364C1F6EBA410005B3D5 /* ScatterChartViewController.swift */; }; + 225B36641F6EBA470005B3D5 /* StackedBarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B364D1F6EBA410005B3D5 /* StackedBarChartViewController.swift */; }; + 225B36651F6EBA470005B3D5 /* BubbleChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B364E1F6EBA410005B3D5 /* BubbleChartViewController.swift */; }; + 225B36661F6EBA470005B3D5 /* LineChartFilledViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B364F1F6EBA410005B3D5 /* LineChartFilledViewController.swift */; }; + 225B36671F6EBA470005B3D5 /* PositiveNegativeBarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36501F6EBA410005B3D5 /* PositiveNegativeBarChartViewController.swift */; }; + 225B36681F6EBA470005B3D5 /* AnotherBarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36511F6EBA410005B3D5 /* AnotherBarChartViewController.swift */; }; + 225B36691F6EBA470005B3D5 /* PieChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36521F6EBA410005B3D5 /* PieChartViewController.swift */; }; + 225B366A1F6EBA470005B3D5 /* CubicLineChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36531F6EBA410005B3D5 /* CubicLineChartViewController.swift */; }; + 225B366B1F6EBA470005B3D5 /* RadarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36541F6EBA410005B3D5 /* RadarChartViewController.swift */; }; + 225B366C1F6EBA470005B3D5 /* HorizontalBarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36551F6EBA410005B3D5 /* HorizontalBarChartViewController.swift */; }; + 225B366D1F6EBA470005B3D5 /* PiePolylineChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36561F6EBA410005B3D5 /* PiePolylineChartViewController.swift */; }; + 225B366E1F6EBA470005B3D5 /* CombinedChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36571F6EBA410005B3D5 /* CombinedChartViewController.swift */; }; + 225B366F1F6EBA470005B3D5 /* BarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36581F6EBA410005B3D5 /* BarChartViewController.swift */; }; + 225B36701F6EBA470005B3D5 /* SinusBarChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B36591F6EBA410005B3D5 /* SinusBarChartViewController.swift */; }; + 225B36711F6EBA470005B3D5 /* CandleStickChartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 225B365A1F6EBA410005B3D5 /* CandleStickChartViewController.swift */; }; + 225B36721F6EBA5E0005B3D5 /* DemoListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B8EAF231AB3271B009697AA /* DemoListViewController.xib */; }; + 225B36731F6EBA5E0005B3D5 /* RadarMarkerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B613DB41D526EA8000F1E98 /* RadarMarkerView.xib */; }; + 225B36741F6EBA640005B3D5 /* AnotherBarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED111ABBFB2B0013F194 /* AnotherBarChartViewController.xib */; }; + 225B36751F6EBA640005B3D5 /* BarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BD47E641ABB424E008FCEC6 /* BarChartViewController.xib */; }; + 225B36761F6EBA640005B3D5 /* BubbleChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55E3564D1ADC638F00A57971 /* BubbleChartViewController.xib */; }; + 225B36771F6EBA640005B3D5 /* CandleStickChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED2B1ABC160F0013F194 /* CandleStickChartViewController.xib */; }; + 225B36781F6EBA640005B3D5 /* ColoredLineChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED3A1ABC199F0013F194 /* ColoredLineChartViewController.xib */; }; + 225B36791F6EBA640005B3D5 /* CombinedChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BDEDC461ABB871E007D3A60 /* CombinedChartViewController.xib */; }; + 225B367A1F6EBA640005B3D5 /* CubicLineChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED301ABC18F00013F194 /* CubicLineChartViewController.xib */; }; + 225B367B1F6EBA640005B3D5 /* HalfPieChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BE6737F1D5B496500A87BA2 /* HalfPieChartViewController.xib */; }; + 225B367C1F6EBA640005B3D5 /* HorizontalBarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BDEDC401ABB7F73007D3A60 /* HorizontalBarChartViewController.xib */; }; + 225B367D1F6EBA640005B3D5 /* LineChart1ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BD8F0731AB89CE500566E05 /* LineChart1ViewController.xib */; }; + 225B367E1F6EBA640005B3D5 /* LineChart2ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BD47E5F1ABB3C91008FCEC6 /* LineChart2ViewController.xib */; }; + 225B367F1F6EBA640005B3D5 /* LineChartFilledViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BE6738E1D5B4E0900A87BA2 /* LineChartFilledViewController.xib */; }; + 225B36801F6EBA640005B3D5 /* LineChartTimeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BE673911D5B4E0900A87BA2 /* LineChartTimeViewController.xib */; }; + 225B36811F6EBA640005B3D5 /* MultipleBarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED211ABC0BE20013F194 /* MultipleBarChartViewController.xib */; }; + 225B36821F6EBA640005B3D5 /* MultipleLinesChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED241ABC0BE20013F194 /* MultipleLinesChartViewController.xib */; }; + 225B36831F6EBA640005B3D5 /* NegativeStackedBarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B9624401B38608C007763E2 /* NegativeStackedBarChartViewController.xib */; }; + 225B36841F6EBA640005B3D5 /* PieChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B0CC7841ABB875400665592 /* PieChartViewController.xib */; }; + 225B36851F6EBA640005B3D5 /* PiePolylineChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0471CBFB1CA1090A00E52DBC /* PiePolylineChartViewController.xib */; }; + 225B36861F6EBA640005B3D5 /* PositiveNegativeBarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BE7E7611C693098000A0377 /* PositiveNegativeBarChartViewController.xib */; }; + 225B36871F6EBA640005B3D5 /* RadarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED351ABC192F0013F194 /* RadarChartViewController.xib */; }; + 225B36881F6EBA640005B3D5 /* RealmDemosViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B1B5DA91E911A15006D1375 /* RealmDemosViewController.xib */; }; + 225B36891F6EBA640005B3D5 /* ScatterChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED171ABBFB340013F194 /* ScatterChartViewController.xib */; }; + 225B368A1F6EBA640005B3D5 /* SinusBarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED3F1ABC1AC60013F194 /* SinusBarChartViewController.xib */; }; + 225B368B1F6EBA640005B3D5 /* StackedBarChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BEAED1A1ABBFB340013F194 /* StackedBarChartViewController.xib */; }; + 225B368C1F6EBBB00005B3D5 /* Charts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0630AE411D8126C0008859B0 /* Charts.framework */; }; + 225B368D1F6EBBB00005B3D5 /* Charts.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0630AE411D8126C0008859B0 /* Charts.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 55E356501ADC638F00A57971 /* BubbleChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55E3564D1ADC638F00A57971 /* BubbleChartViewController.xib */; }; 55E356511ADC638F00A57971 /* BubbleChartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55E3564F1ADC638F00A57971 /* BubbleChartViewController.m */; }; 5B0CC7851ABB875400665592 /* PieChartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B0CC7831ABB875400665592 /* PieChartViewController.m */; }; 5B0CC7861ABB875400665592 /* PieChartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B0CC7841ABB875400665592 /* PieChartViewController.xib */; }; - 5B1B5DAA1E911A15006D1375 /* RealmDemosViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B1B5DA81E911A15006D1375 /* RealmDemosViewController.m */; }; 5B1B5DAB1E911A15006D1375 /* RealmDemosViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B1B5DA91E911A15006D1375 /* RealmDemosViewController.xib */; }; 5B4316271AB8D8AE0009FCAA /* Icon-29@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5B43161F1AB8D8AE0009FCAA /* Icon-29@2x.png */; }; 5B4316281AB8D8AE0009FCAA /* Icon-29@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5B4316201AB8D8AE0009FCAA /* Icon-29@3x.png */; }; @@ -105,9 +165,27 @@ remoteGlobalIDString = A58A4ED274A941CA248EA921; remoteInfo = Charts; }; + 225B368E1F6EBBB00005B3D5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0630AE391D8126C0008859B0 /* Charts.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 06165F231D8110E600722320; + remoteInfo = Charts; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 225B36901F6EBBB10005B3D5 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 225B368D1F6EBBB00005B3D5 /* Charts.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; 5BB4B0751ACA710D00E2EF4D /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -126,15 +204,48 @@ 0439A3521C9FF95F00496F83 /* PiePolylineChartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PiePolylineChartViewController.m; sourceTree = ""; }; 0471CBFB1CA1090A00E52DBC /* PiePolylineChartViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PiePolylineChartViewController.xib; sourceTree = ""; }; 0630AE391D8126C0008859B0 /* Charts.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Charts.xcodeproj; path = ../Charts.xcodeproj; sourceTree = ""; }; + 066750AC1E2DB68D00E22DC6 /* Carthage.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Carthage.xcconfig; path = ../Carthage.xcconfig; sourceTree = ""; }; + 225B361D1F6EB9A50005B3D5 /* ChartsDemo-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ChartsDemo-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 225B361F1F6EB9A50005B3D5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 225B362F1F6EB9EE0005B3D5 /* DemoBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoBaseViewController.swift; sourceTree = ""; }; + 225B36301F6EB9EE0005B3D5 /* DemoListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoListViewController.swift; sourceTree = ""; }; + 225B36341F6EB9FE0005B3D5 /* IntAxisValueFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntAxisValueFormatter.swift; sourceTree = ""; }; + 225B36351F6EB9FE0005B3D5 /* DayAxisValueFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayAxisValueFormatter.swift; sourceTree = ""; }; + 225B36361F6EB9FE0005B3D5 /* DateValueFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateValueFormatter.swift; sourceTree = ""; }; + 225B36371F6EB9FE0005B3D5 /* LargeValueFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LargeValueFormatter.swift; sourceTree = ""; }; + 225B363D1F6EBA180005B3D5 /* XYMarkerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XYMarkerView.swift; sourceTree = ""; }; + 225B363E1F6EBA180005B3D5 /* BalloonMarker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalloonMarker.swift; sourceTree = ""; }; + 225B363F1F6EBA180005B3D5 /* RadarMarkerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadarMarkerView.swift; sourceTree = ""; }; + 225B36441F6EBA410005B3D5 /* MultipleLinesChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultipleLinesChartViewController.swift; sourceTree = ""; }; + 225B36451F6EBA410005B3D5 /* MultipleBarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultipleBarChartViewController.swift; sourceTree = ""; }; + 225B36461F6EBA410005B3D5 /* HalfPieChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HalfPieChartViewController.swift; sourceTree = ""; }; + 225B36471F6EBA410005B3D5 /* LineChartTimeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineChartTimeViewController.swift; sourceTree = ""; }; + 225B36481F6EBA410005B3D5 /* ColoredLineChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColoredLineChartViewController.swift; sourceTree = ""; }; + 225B36491F6EBA410005B3D5 /* LineChart2ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineChart2ViewController.swift; sourceTree = ""; }; + 225B364A1F6EBA410005B3D5 /* LineChart1ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineChart1ViewController.swift; sourceTree = ""; }; + 225B364B1F6EBA410005B3D5 /* NegativeStackedBarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NegativeStackedBarChartViewController.swift; sourceTree = ""; }; + 225B364C1F6EBA410005B3D5 /* ScatterChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScatterChartViewController.swift; sourceTree = ""; }; + 225B364D1F6EBA410005B3D5 /* StackedBarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedBarChartViewController.swift; sourceTree = ""; }; + 225B364E1F6EBA410005B3D5 /* BubbleChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BubbleChartViewController.swift; sourceTree = ""; }; + 225B364F1F6EBA410005B3D5 /* LineChartFilledViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineChartFilledViewController.swift; sourceTree = ""; }; + 225B36501F6EBA410005B3D5 /* PositiveNegativeBarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PositiveNegativeBarChartViewController.swift; sourceTree = ""; }; + 225B36511F6EBA410005B3D5 /* AnotherBarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherBarChartViewController.swift; sourceTree = ""; }; + 225B36521F6EBA410005B3D5 /* PieChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PieChartViewController.swift; sourceTree = ""; }; + 225B36531F6EBA410005B3D5 /* CubicLineChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CubicLineChartViewController.swift; sourceTree = ""; }; + 225B36541F6EBA410005B3D5 /* RadarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadarChartViewController.swift; sourceTree = ""; }; + 225B36551F6EBA410005B3D5 /* HorizontalBarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HorizontalBarChartViewController.swift; sourceTree = ""; }; + 225B36561F6EBA410005B3D5 /* PiePolylineChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PiePolylineChartViewController.swift; sourceTree = ""; }; + 225B36571F6EBA410005B3D5 /* CombinedChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombinedChartViewController.swift; sourceTree = ""; }; + 225B36581F6EBA410005B3D5 /* BarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BarChartViewController.swift; sourceTree = ""; }; + 225B36591F6EBA410005B3D5 /* SinusBarChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SinusBarChartViewController.swift; sourceTree = ""; }; + 225B365A1F6EBA410005B3D5 /* CandleStickChartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CandleStickChartViewController.swift; sourceTree = ""; }; 55E3564D1ADC638F00A57971 /* BubbleChartViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BubbleChartViewController.xib; sourceTree = ""; }; 55E3564E1ADC638F00A57971 /* BubbleChartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BubbleChartViewController.h; sourceTree = ""; }; 55E3564F1ADC638F00A57971 /* BubbleChartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BubbleChartViewController.m; sourceTree = ""; }; 5B0CC7821ABB875400665592 /* PieChartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PieChartViewController.h; sourceTree = ""; }; 5B0CC7831ABB875400665592 /* PieChartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PieChartViewController.m; sourceTree = ""; }; 5B0CC7841ABB875400665592 /* PieChartViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PieChartViewController.xib; sourceTree = ""; }; - 5B1B5DA71E911A15006D1375 /* RealmDemosViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RealmDemosViewController.h; path = Classes/RealmDemosViewController.h; sourceTree = SOURCE_ROOT; }; - 5B1B5DA81E911A15006D1375 /* RealmDemosViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RealmDemosViewController.m; path = Classes/RealmDemosViewController.m; sourceTree = SOURCE_ROOT; }; - 5B1B5DA91E911A15006D1375 /* RealmDemosViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = RealmDemosViewController.xib; path = Classes/RealmDemosViewController.xib; sourceTree = SOURCE_ROOT; }; + 5B1B5DA91E911A15006D1375 /* RealmDemosViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = RealmDemosViewController.xib; path = XIBs/Demos/RealmDemosViewController.xib; sourceTree = SOURCE_ROOT; }; 5B43161F1AB8D8AE0009FCAA /* Icon-29@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-29@2x.png"; sourceTree = ""; }; 5B4316201AB8D8AE0009FCAA /* Icon-29@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-29@3x.png"; sourceTree = ""; }; 5B4316211AB8D8AE0009FCAA /* Icon-40@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-40@2x.png"; sourceTree = ""; }; @@ -231,6 +342,14 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 225B361A1F6EB9A50005B3D5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 225B368C1F6EBBB00005B3D5 /* Charts.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5B57BBAC1A9B26AA0036A6CC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -251,6 +370,111 @@ name = Products; sourceTree = ""; }; + 225B361E1F6EB9A50005B3D5 /* Swift */ = { + isa = PBXGroup; + children = ( + 225B361F1F6EB9A50005B3D5 /* AppDelegate.swift */, + 225B362F1F6EB9EE0005B3D5 /* DemoBaseViewController.swift */, + 225B36301F6EB9EE0005B3D5 /* DemoListViewController.swift */, + 225B363C1F6EBA180005B3D5 /* Components */, + 225B36331F6EB9FE0005B3D5 /* Formatters */, + 225B36431F6EBA410005B3D5 /* Demos */, + ); + path = Swift; + sourceTree = ""; + }; + 225B36331F6EB9FE0005B3D5 /* Formatters */ = { + isa = PBXGroup; + children = ( + 225B36351F6EB9FE0005B3D5 /* DayAxisValueFormatter.swift */, + 225B36361F6EB9FE0005B3D5 /* DateValueFormatter.swift */, + 225B36341F6EB9FE0005B3D5 /* IntAxisValueFormatter.swift */, + 225B36371F6EB9FE0005B3D5 /* LargeValueFormatter.swift */, + ); + path = Formatters; + sourceTree = ""; + }; + 225B363C1F6EBA180005B3D5 /* Components */ = { + isa = PBXGroup; + children = ( + 225B363E1F6EBA180005B3D5 /* BalloonMarker.swift */, + 225B363F1F6EBA180005B3D5 /* RadarMarkerView.swift */, + 225B363D1F6EBA180005B3D5 /* XYMarkerView.swift */, + ); + path = Components; + sourceTree = ""; + }; + 225B36431F6EBA410005B3D5 /* Demos */ = { + isa = PBXGroup; + children = ( + 225B36511F6EBA410005B3D5 /* AnotherBarChartViewController.swift */, + 225B36581F6EBA410005B3D5 /* BarChartViewController.swift */, + 225B364E1F6EBA410005B3D5 /* BubbleChartViewController.swift */, + 225B365A1F6EBA410005B3D5 /* CandleStickChartViewController.swift */, + 225B36481F6EBA410005B3D5 /* ColoredLineChartViewController.swift */, + 225B36571F6EBA410005B3D5 /* CombinedChartViewController.swift */, + 225B36531F6EBA410005B3D5 /* CubicLineChartViewController.swift */, + 225B36461F6EBA410005B3D5 /* HalfPieChartViewController.swift */, + 225B36551F6EBA410005B3D5 /* HorizontalBarChartViewController.swift */, + 225B364A1F6EBA410005B3D5 /* LineChart1ViewController.swift */, + 225B36491F6EBA410005B3D5 /* LineChart2ViewController.swift */, + 225B364F1F6EBA410005B3D5 /* LineChartFilledViewController.swift */, + 225B36471F6EBA410005B3D5 /* LineChartTimeViewController.swift */, + 225B36441F6EBA410005B3D5 /* MultipleLinesChartViewController.swift */, + 225B36451F6EBA410005B3D5 /* MultipleBarChartViewController.swift */, + 225B364B1F6EBA410005B3D5 /* NegativeStackedBarChartViewController.swift */, + 225B36521F6EBA410005B3D5 /* PieChartViewController.swift */, + 225B36561F6EBA410005B3D5 /* PiePolylineChartViewController.swift */, + 225B36501F6EBA410005B3D5 /* PositiveNegativeBarChartViewController.swift */, + 225B36541F6EBA410005B3D5 /* RadarChartViewController.swift */, + 225B364C1F6EBA410005B3D5 /* ScatterChartViewController.swift */, + 225B36591F6EBA410005B3D5 /* SinusBarChartViewController.swift */, + 225B364D1F6EBA410005B3D5 /* StackedBarChartViewController.swift */, + ); + path = Demos; + sourceTree = ""; + }; + 227136F41F6EB665006D2A11 /* XIBs */ = { + isa = PBXGroup; + children = ( + 5B8EAF231AB3271B009697AA /* DemoListViewController.xib */, + 5B613DB41D526EA8000F1E98 /* RadarMarkerView.xib */, + 227136F61F6EB69D006D2A11 /* Demos */, + ); + path = XIBs; + sourceTree = ""; + }; + 227136F61F6EB69D006D2A11 /* Demos */ = { + isa = PBXGroup; + children = ( + 5BEAED111ABBFB2B0013F194 /* AnotherBarChartViewController.xib */, + 5BD47E641ABB424E008FCEC6 /* BarChartViewController.xib */, + 55E3564D1ADC638F00A57971 /* BubbleChartViewController.xib */, + 5BEAED2B1ABC160F0013F194 /* CandleStickChartViewController.xib */, + 5BEAED3A1ABC199F0013F194 /* ColoredLineChartViewController.xib */, + 5BDEDC461ABB871E007D3A60 /* CombinedChartViewController.xib */, + 5BEAED301ABC18F00013F194 /* CubicLineChartViewController.xib */, + 5BE6737F1D5B496500A87BA2 /* HalfPieChartViewController.xib */, + 5BDEDC401ABB7F73007D3A60 /* HorizontalBarChartViewController.xib */, + 5BD8F0731AB89CE500566E05 /* LineChart1ViewController.xib */, + 5BD47E5F1ABB3C91008FCEC6 /* LineChart2ViewController.xib */, + 5BE6738E1D5B4E0900A87BA2 /* LineChartFilledViewController.xib */, + 5BE673911D5B4E0900A87BA2 /* LineChartTimeViewController.xib */, + 5BEAED211ABC0BE20013F194 /* MultipleBarChartViewController.xib */, + 5BEAED241ABC0BE20013F194 /* MultipleLinesChartViewController.xib */, + 5B9624401B38608C007763E2 /* NegativeStackedBarChartViewController.xib */, + 5B0CC7841ABB875400665592 /* PieChartViewController.xib */, + 0471CBFB1CA1090A00E52DBC /* PiePolylineChartViewController.xib */, + 5BE7E7611C693098000A0377 /* PositiveNegativeBarChartViewController.xib */, + 5BEAED351ABC192F0013F194 /* RadarChartViewController.xib */, + 5B1B5DA91E911A15006D1375 /* RealmDemosViewController.xib */, + 5BEAED171ABBFB340013F194 /* ScatterChartViewController.xib */, + 5BEAED3F1ABC1AC60013F194 /* SinusBarChartViewController.xib */, + 5BEAED1A1ABBFB340013F194 /* StackedBarChartViewController.xib */, + ); + path = Demos; + sourceTree = ""; + }; 5B43161E1AB8D8AE0009FCAA /* app-icon */ = { isa = PBXGroup; children = ( @@ -269,7 +493,10 @@ 5B57BBA61A9B26AA0036A6CC = { isa = PBXGroup; children = ( - 5B57BBB11A9B26AA0036A6CC /* Classes */, + 066750AC1E2DB68D00E22DC6 /* Carthage.xcconfig */, + 5B57BBB11A9B26AA0036A6CC /* Objective-C */, + 225B361E1F6EB9A50005B3D5 /* Swift */, + 227136F41F6EB665006D2A11 /* XIBs */, 5B8EAF2E1AB32E15009697AA /* Resources */, 5B57BBB21A9B26AA0036A6CC /* Supporting Files */, 5B57BBB01A9B26AA0036A6CC /* Products */, @@ -281,25 +508,25 @@ isa = PBXGroup; children = ( 5B57BBAF1A9B26AA0036A6CC /* ChartsDemo.app */, + 225B361D1F6EB9A50005B3D5 /* ChartsDemo-Swift.app */, ); name = Products; sourceTree = ""; }; - 5B57BBB11A9B26AA0036A6CC /* Classes */ = { + 5B57BBB11A9B26AA0036A6CC /* Objective-C */ = { isa = PBXGroup; children = ( 5B57BBB61A9B26AA0036A6CC /* AppDelegate.h */, 5B57BBB71A9B26AA0036A6CC /* AppDelegate.m */, 5B57BBB91A9B26AA0036A6CC /* DemoListViewController.h */, 5B57BBBA1A9B26AA0036A6CC /* DemoListViewController.m */, - 5B8EAF231AB3271B009697AA /* DemoListViewController.xib */, 5B8EAF251AB32CF5009697AA /* DemoBaseViewController.h */, 5B8EAF261AB32CF5009697AA /* DemoBaseViewController.m */, 5BE377D41D42511A006EB34F /* Formatters */, 5BD47E541ABB0177008FCEC6 /* Components */, 5BD8F06F1AB89C7100566E05 /* Demos */, ); - path = Classes; + path = "Objective-C"; sourceTree = ""; }; 5B57BBB21A9B26AA0036A6CC /* Supporting Files */ = { @@ -336,7 +563,6 @@ children = ( 5BD47E5A1ABB0263008FCEC6 /* BalloonMarker.swift */, 5B613DB21D526DED000F1E98 /* RadarMarkerView.swift */, - 5B613DB41D526EA8000F1E98 /* RadarMarkerView.xib */, 5B613DEF1D5A50B6000F1E98 /* XYMarkerView.swift */, ); path = Components; @@ -347,76 +573,50 @@ children = ( 5BEAED0F1ABBFB2B0013F194 /* AnotherBarChartViewController.h */, 5BEAED101ABBFB2B0013F194 /* AnotherBarChartViewController.m */, - 5BEAED111ABBFB2B0013F194 /* AnotherBarChartViewController.xib */, 5BD47E621ABB424E008FCEC6 /* BarChartViewController.h */, 5BD47E631ABB424E008FCEC6 /* BarChartViewController.m */, - 5BD47E641ABB424E008FCEC6 /* BarChartViewController.xib */, 55E3564E1ADC638F00A57971 /* BubbleChartViewController.h */, 55E3564F1ADC638F00A57971 /* BubbleChartViewController.m */, - 55E3564D1ADC638F00A57971 /* BubbleChartViewController.xib */, 5BEAED291ABC160F0013F194 /* CandleStickChartViewController.h */, 5BEAED2A1ABC160F0013F194 /* CandleStickChartViewController.m */, - 5BEAED2B1ABC160F0013F194 /* CandleStickChartViewController.xib */, 5BEAED381ABC199F0013F194 /* ColoredLineChartViewController.h */, 5BEAED391ABC199F0013F194 /* ColoredLineChartViewController.m */, - 5BEAED3A1ABC199F0013F194 /* ColoredLineChartViewController.xib */, 5BDEDC441ABB871E007D3A60 /* CombinedChartViewController.h */, 5BDEDC451ABB871E007D3A60 /* CombinedChartViewController.m */, - 5BDEDC461ABB871E007D3A60 /* CombinedChartViewController.xib */, 5BEAED2E1ABC18F00013F194 /* CubicLineChartViewController.h */, 5BEAED2F1ABC18F00013F194 /* CubicLineChartViewController.m */, - 5BEAED301ABC18F00013F194 /* CubicLineChartViewController.xib */, 5BE6737D1D5B496500A87BA2 /* HalfPieChartViewController.h */, 5BE6737E1D5B496500A87BA2 /* HalfPieChartViewController.m */, - 5BE6737F1D5B496500A87BA2 /* HalfPieChartViewController.xib */, 5BDEDC3E1ABB7F73007D3A60 /* HorizontalBarChartViewController.h */, 5BDEDC3F1ABB7F73007D3A60 /* HorizontalBarChartViewController.m */, - 5BDEDC401ABB7F73007D3A60 /* HorizontalBarChartViewController.xib */, 5BD8F0711AB89CE500566E05 /* LineChart1ViewController.h */, 5BD8F0721AB89CE500566E05 /* LineChart1ViewController.m */, - 5BD8F0731AB89CE500566E05 /* LineChart1ViewController.xib */, 5BD47E5D1ABB3C91008FCEC6 /* LineChart2ViewController.h */, 5BD47E5E1ABB3C91008FCEC6 /* LineChart2ViewController.m */, - 5BD47E5F1ABB3C91008FCEC6 /* LineChart2ViewController.xib */, 5BE6738C1D5B4E0900A87BA2 /* LineChartFilledViewController.h */, 5BE6738D1D5B4E0900A87BA2 /* LineChartFilledViewController.m */, - 5BE6738E1D5B4E0900A87BA2 /* LineChartFilledViewController.xib */, 5BE6738F1D5B4E0900A87BA2 /* LineChartTimeViewController.h */, 5BE673901D5B4E0900A87BA2 /* LineChartTimeViewController.m */, - 5BE673911D5B4E0900A87BA2 /* LineChartTimeViewController.xib */, 5BEAED1F1ABC0BE20013F194 /* MultipleBarChartViewController.h */, 5BEAED201ABC0BE20013F194 /* MultipleBarChartViewController.m */, - 5BEAED211ABC0BE20013F194 /* MultipleBarChartViewController.xib */, 5BEAED221ABC0BE20013F194 /* MultipleLinesChartViewController.h */, 5BEAED231ABC0BE20013F194 /* MultipleLinesChartViewController.m */, - 5BEAED241ABC0BE20013F194 /* MultipleLinesChartViewController.xib */, 5B96243E1B38608C007763E2 /* NegativeStackedBarChartViewController.h */, 5B96243F1B38608C007763E2 /* NegativeStackedBarChartViewController.m */, - 5B9624401B38608C007763E2 /* NegativeStackedBarChartViewController.xib */, 5B0CC7821ABB875400665592 /* PieChartViewController.h */, 5B0CC7831ABB875400665592 /* PieChartViewController.m */, - 5B0CC7841ABB875400665592 /* PieChartViewController.xib */, 0439A3511C9FF95F00496F83 /* PiePolylineChartViewController.h */, 0439A3521C9FF95F00496F83 /* PiePolylineChartViewController.m */, - 0471CBFB1CA1090A00E52DBC /* PiePolylineChartViewController.xib */, 5BE7E75F1C693098000A0377 /* PositiveNegativeBarChartViewController.h */, 5BE7E7601C693098000A0377 /* PositiveNegativeBarChartViewController.m */, - 5BE7E7611C693098000A0377 /* PositiveNegativeBarChartViewController.xib */, 5BEAED331ABC192F0013F194 /* RadarChartViewController.h */, 5BEAED341ABC192F0013F194 /* RadarChartViewController.m */, - 5BEAED351ABC192F0013F194 /* RadarChartViewController.xib */, - 5B1B5DA71E911A15006D1375 /* RealmDemosViewController.h */, - 5B1B5DA81E911A15006D1375 /* RealmDemosViewController.m */, - 5B1B5DA91E911A15006D1375 /* RealmDemosViewController.xib */, 5BEAED151ABBFB340013F194 /* ScatterChartViewController.h */, 5BEAED161ABBFB340013F194 /* ScatterChartViewController.m */, - 5BEAED171ABBFB340013F194 /* ScatterChartViewController.xib */, 5BEAED3D1ABC1AC60013F194 /* SinusBarChartViewController.h */, 5BEAED3E1ABC1AC60013F194 /* SinusBarChartViewController.m */, - 5BEAED3F1ABC1AC60013F194 /* SinusBarChartViewController.xib */, 5BEAED181ABBFB340013F194 /* StackedBarChartViewController.h */, 5BEAED191ABBFB340013F194 /* StackedBarChartViewController.m */, - 5BEAED1A1ABBFB340013F194 /* StackedBarChartViewController.xib */, ); path = Demos; sourceTree = ""; @@ -438,6 +638,25 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 225B361C1F6EB9A50005B3D5 /* ChartsDemo-Swift */ = { + isa = PBXNativeTarget; + buildConfigurationList = 225B362C1F6EB9A50005B3D5 /* Build configuration list for PBXNativeTarget "ChartsDemo-Swift" */; + buildPhases = ( + 225B36191F6EB9A50005B3D5 /* Sources */, + 225B361A1F6EB9A50005B3D5 /* Frameworks */, + 225B361B1F6EB9A50005B3D5 /* Resources */, + 225B36901F6EBBB10005B3D5 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 225B368F1F6EBBB00005B3D5 /* PBXTargetDependency */, + ); + name = "ChartsDemo-Swift"; + productName = "ChartsDemo-Swift"; + productReference = 225B361D1F6EB9A50005B3D5 /* ChartsDemo-Swift.app */; + productType = "com.apple.product-type.application"; + }; 5B57BBAE1A9B26AA0036A6CC /* ChartsDemo */ = { isa = PBXNativeTarget; buildConfigurationList = 5B57BBD21A9B26AA0036A6CC /* Build configuration list for PBXNativeTarget "ChartsDemo" */; @@ -468,6 +687,10 @@ LastUpgradeCheck = 0900; ORGANIZATIONNAME = dcg; TargetAttributes = { + 225B361C1F6EB9A50005B3D5 = { + CreatedOnToolsVersion = 9.0; + ProvisioningStyle = Automatic; + }; 5B57BBAE1A9B26AA0036A6CC = { CreatedOnToolsVersion = 6.1.1; LastSwiftMigration = 0900; @@ -495,6 +718,7 @@ projectRoot = ""; targets = ( 5B57BBAE1A9B26AA0036A6CC /* ChartsDemo */, + 225B361C1F6EB9A50005B3D5 /* ChartsDemo-Swift */, ); }; /* End PBXProject section */ @@ -517,6 +741,39 @@ /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ + 225B361B1F6EB9A50005B3D5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 225B367C1F6EBA640005B3D5 /* HorizontalBarChartViewController.xib in Resources */, + 225B36841F6EBA640005B3D5 /* PieChartViewController.xib in Resources */, + 225B36741F6EBA640005B3D5 /* AnotherBarChartViewController.xib in Resources */, + 225B36781F6EBA640005B3D5 /* ColoredLineChartViewController.xib in Resources */, + 225B36791F6EBA640005B3D5 /* CombinedChartViewController.xib in Resources */, + 225B367B1F6EBA640005B3D5 /* HalfPieChartViewController.xib in Resources */, + 225B367A1F6EBA640005B3D5 /* CubicLineChartViewController.xib in Resources */, + 225B368B1F6EBA640005B3D5 /* StackedBarChartViewController.xib in Resources */, + 225B36821F6EBA640005B3D5 /* MultipleLinesChartViewController.xib in Resources */, + 225B36751F6EBA640005B3D5 /* BarChartViewController.xib in Resources */, + 225B367F1F6EBA640005B3D5 /* LineChartFilledViewController.xib in Resources */, + 225B36801F6EBA640005B3D5 /* LineChartTimeViewController.xib in Resources */, + 225B36811F6EBA640005B3D5 /* MultipleBarChartViewController.xib in Resources */, + 225B367D1F6EBA640005B3D5 /* LineChart1ViewController.xib in Resources */, + 225B36721F6EBA5E0005B3D5 /* DemoListViewController.xib in Resources */, + 225B36891F6EBA640005B3D5 /* ScatterChartViewController.xib in Resources */, + 225B36851F6EBA640005B3D5 /* PiePolylineChartViewController.xib in Resources */, + 225B36771F6EBA640005B3D5 /* CandleStickChartViewController.xib in Resources */, + 225B36871F6EBA640005B3D5 /* RadarChartViewController.xib in Resources */, + 225B368A1F6EBA640005B3D5 /* SinusBarChartViewController.xib in Resources */, + 225B36731F6EBA5E0005B3D5 /* RadarMarkerView.xib in Resources */, + 225B367E1F6EBA640005B3D5 /* LineChart2ViewController.xib in Resources */, + 225B36881F6EBA640005B3D5 /* RealmDemosViewController.xib in Resources */, + 225B36861F6EBA640005B3D5 /* PositiveNegativeBarChartViewController.xib in Resources */, + 225B36831F6EBA640005B3D5 /* NegativeStackedBarChartViewController.xib in Resources */, + 225B36761F6EBA640005B3D5 /* BubbleChartViewController.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5B57BBAD1A9B26AA0036A6CC /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -564,12 +821,51 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 225B36191F6EB9A50005B3D5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 225B365E1F6EBA470005B3D5 /* LineChartTimeViewController.swift in Sources */, + 225B36311F6EB9EE0005B3D5 /* DemoBaseViewController.swift in Sources */, + 225B36391F6EBA040005B3D5 /* DayAxisValueFormatter.swift in Sources */, + 225B36661F6EBA470005B3D5 /* LineChartFilledViewController.swift in Sources */, + 225B366A1F6EBA470005B3D5 /* CubicLineChartViewController.swift in Sources */, + 225B36671F6EBA470005B3D5 /* PositiveNegativeBarChartViewController.swift in Sources */, + 225B363A1F6EBA040005B3D5 /* DateValueFormatter.swift in Sources */, + 225B366D1F6EBA470005B3D5 /* PiePolylineChartViewController.swift in Sources */, + 225B366F1F6EBA470005B3D5 /* BarChartViewController.swift in Sources */, + 225B36601F6EBA470005B3D5 /* LineChart2ViewController.swift in Sources */, + 225B36411F6EBA1D0005B3D5 /* BalloonMarker.swift in Sources */, + 225B366C1F6EBA470005B3D5 /* HorizontalBarChartViewController.swift in Sources */, + 225B36401F6EBA1D0005B3D5 /* XYMarkerView.swift in Sources */, + 225B36421F6EBA1D0005B3D5 /* RadarMarkerView.swift in Sources */, + 225B366B1F6EBA470005B3D5 /* RadarChartViewController.swift in Sources */, + 225B36611F6EBA470005B3D5 /* LineChart1ViewController.swift in Sources */, + 225B36691F6EBA470005B3D5 /* PieChartViewController.swift in Sources */, + 225B365B1F6EBA470005B3D5 /* MultipleLinesChartViewController.swift in Sources */, + 225B365F1F6EBA470005B3D5 /* ColoredLineChartViewController.swift in Sources */, + 225B36201F6EB9A50005B3D5 /* AppDelegate.swift in Sources */, + 225B36321F6EB9EE0005B3D5 /* DemoListViewController.swift in Sources */, + 225B36711F6EBA470005B3D5 /* CandleStickChartViewController.swift in Sources */, + 225B36631F6EBA470005B3D5 /* ScatterChartViewController.swift in Sources */, + 225B365C1F6EBA470005B3D5 /* MultipleBarChartViewController.swift in Sources */, + 225B366E1F6EBA470005B3D5 /* CombinedChartViewController.swift in Sources */, + 225B36641F6EBA470005B3D5 /* StackedBarChartViewController.swift in Sources */, + 225B36651F6EBA470005B3D5 /* BubbleChartViewController.swift in Sources */, + 225B36381F6EBA040005B3D5 /* IntAxisValueFormatter.swift in Sources */, + 225B365D1F6EBA470005B3D5 /* HalfPieChartViewController.swift in Sources */, + 225B36701F6EBA470005B3D5 /* SinusBarChartViewController.swift in Sources */, + 225B36681F6EBA470005B3D5 /* AnotherBarChartViewController.swift in Sources */, + 225B36621F6EBA470005B3D5 /* NegativeStackedBarChartViewController.swift in Sources */, + 225B363B1F6EBA040005B3D5 /* LargeValueFormatter.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5B57BBAB1A9B26AA0036A6CC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 5B613DF21D5A60DF000F1E98 /* LargeValueFormatter.swift in Sources */, - 5B1B5DAA1E911A15006D1375 /* RealmDemosViewController.m in Sources */, 5BEAED1B1ABBFB340013F194 /* ScatterChartViewController.m in Sources */, 5B0CC7851ABB875400665592 /* PieChartViewController.m in Sources */, 0439A3541C9FF95F00496F83 /* PiePolylineChartViewController.m in Sources */, @@ -614,9 +910,79 @@ name = Charts; targetProxy = 0630AE531D81271B008859B0 /* PBXContainerItemProxy */; }; + 225B368F1F6EBBB00005B3D5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Charts; + targetProxy = 225B368E1F6EBBB00005B3D5 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 225B362D1F6EB9A50005B3D5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.ChartsDemo-Swift"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; + 225B362E1F6EB9A50005B3D5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.ChartsDemo-Swift"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Release; + }; 5B57BBD01A9B26AA0036A6CC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -660,7 +1026,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -703,7 +1069,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -759,6 +1125,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 225B362C1F6EB9A50005B3D5 /* Build configuration list for PBXNativeTarget "ChartsDemo-Swift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 225B362D1F6EB9A50005B3D5 /* Debug */, + 225B362E1F6EB9A50005B3D5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 5B57BBAA1A9B26AA0036A6CC /* Build configuration list for PBXProject "ChartsDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ChartsDemo/Classes/RealmDemosViewController.h b/ChartsDemo/Classes/RealmDemosViewController.h deleted file mode 100644 index d73426e995..0000000000 --- a/ChartsDemo/Classes/RealmDemosViewController.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// RealmDemosViewController.h -// ChartsDemo -// -// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda -// A port of MPAndroidChart for iOS -// Licensed under Apache License 2.0 -// -// https://github.com/danielgindi/Charts -// - -#import -#import "DemoBaseViewController.h" -#import - -@interface RealmDemosViewController : DemoBaseViewController - -@end diff --git a/ChartsDemo/Classes/RealmDemosViewController.m b/ChartsDemo/Classes/RealmDemosViewController.m deleted file mode 100644 index 52b7811661..0000000000 --- a/ChartsDemo/Classes/RealmDemosViewController.m +++ /dev/null @@ -1,35 +0,0 @@ -// -// RealmDemosViewController.m -// ChartsDemo -// -// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda -// A port of MPAndroidChart for iOS -// Licensed under Apache License 2.0 -// -// https://github.com/danielgindi/Charts -// - -#import "RealmDemosViewController.h" -#import "ChartsDemo-Swift.h" - -@interface RealmDemosViewController () - -@end - -@implementation RealmDemosViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - self.title = @"Realm demos"; - -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -@end diff --git a/ChartsDemo/Classes/AppDelegate.h b/ChartsDemo/Objective-C/AppDelegate.h similarity index 100% rename from ChartsDemo/Classes/AppDelegate.h rename to ChartsDemo/Objective-C/AppDelegate.h diff --git a/ChartsDemo/Classes/AppDelegate.m b/ChartsDemo/Objective-C/AppDelegate.m similarity index 100% rename from ChartsDemo/Classes/AppDelegate.m rename to ChartsDemo/Objective-C/AppDelegate.m diff --git a/ChartsDemo/Classes/Components/BalloonMarker.swift b/ChartsDemo/Objective-C/Components/BalloonMarker.swift similarity index 100% rename from ChartsDemo/Classes/Components/BalloonMarker.swift rename to ChartsDemo/Objective-C/Components/BalloonMarker.swift diff --git a/ChartsDemo/Classes/Components/RadarMarkerView.swift b/ChartsDemo/Objective-C/Components/RadarMarkerView.swift similarity index 100% rename from ChartsDemo/Classes/Components/RadarMarkerView.swift rename to ChartsDemo/Objective-C/Components/RadarMarkerView.swift diff --git a/ChartsDemo/Classes/Components/XYMarkerView.swift b/ChartsDemo/Objective-C/Components/XYMarkerView.swift similarity index 100% rename from ChartsDemo/Classes/Components/XYMarkerView.swift rename to ChartsDemo/Objective-C/Components/XYMarkerView.swift diff --git a/ChartsDemo/Classes/DemoBaseViewController.h b/ChartsDemo/Objective-C/DemoBaseViewController.h similarity index 100% rename from ChartsDemo/Classes/DemoBaseViewController.h rename to ChartsDemo/Objective-C/DemoBaseViewController.h diff --git a/ChartsDemo/Classes/DemoBaseViewController.m b/ChartsDemo/Objective-C/DemoBaseViewController.m similarity index 100% rename from ChartsDemo/Classes/DemoBaseViewController.m rename to ChartsDemo/Objective-C/DemoBaseViewController.m diff --git a/ChartsDemo/Classes/DemoListViewController.h b/ChartsDemo/Objective-C/DemoListViewController.h similarity index 100% rename from ChartsDemo/Classes/DemoListViewController.h rename to ChartsDemo/Objective-C/DemoListViewController.h diff --git a/ChartsDemo/Classes/DemoListViewController.m b/ChartsDemo/Objective-C/DemoListViewController.m similarity index 100% rename from ChartsDemo/Classes/DemoListViewController.m rename to ChartsDemo/Objective-C/DemoListViewController.m diff --git a/ChartsDemo/Classes/Demos/AnotherBarChartViewController.h b/ChartsDemo/Objective-C/Demos/AnotherBarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/AnotherBarChartViewController.h rename to ChartsDemo/Objective-C/Demos/AnotherBarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/AnotherBarChartViewController.m b/ChartsDemo/Objective-C/Demos/AnotherBarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/AnotherBarChartViewController.m rename to ChartsDemo/Objective-C/Demos/AnotherBarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/BarChartViewController.h b/ChartsDemo/Objective-C/Demos/BarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/BarChartViewController.h rename to ChartsDemo/Objective-C/Demos/BarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/BarChartViewController.m b/ChartsDemo/Objective-C/Demos/BarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/BarChartViewController.m rename to ChartsDemo/Objective-C/Demos/BarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/BubbleChartViewController.h b/ChartsDemo/Objective-C/Demos/BubbleChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/BubbleChartViewController.h rename to ChartsDemo/Objective-C/Demos/BubbleChartViewController.h diff --git a/ChartsDemo/Classes/Demos/BubbleChartViewController.m b/ChartsDemo/Objective-C/Demos/BubbleChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/BubbleChartViewController.m rename to ChartsDemo/Objective-C/Demos/BubbleChartViewController.m diff --git a/ChartsDemo/Classes/Demos/CandleStickChartViewController.h b/ChartsDemo/Objective-C/Demos/CandleStickChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/CandleStickChartViewController.h rename to ChartsDemo/Objective-C/Demos/CandleStickChartViewController.h diff --git a/ChartsDemo/Classes/Demos/CandleStickChartViewController.m b/ChartsDemo/Objective-C/Demos/CandleStickChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/CandleStickChartViewController.m rename to ChartsDemo/Objective-C/Demos/CandleStickChartViewController.m diff --git a/ChartsDemo/Classes/Demos/ColoredLineChartViewController.h b/ChartsDemo/Objective-C/Demos/ColoredLineChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/ColoredLineChartViewController.h rename to ChartsDemo/Objective-C/Demos/ColoredLineChartViewController.h diff --git a/ChartsDemo/Classes/Demos/ColoredLineChartViewController.m b/ChartsDemo/Objective-C/Demos/ColoredLineChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/ColoredLineChartViewController.m rename to ChartsDemo/Objective-C/Demos/ColoredLineChartViewController.m diff --git a/ChartsDemo/Classes/Demos/CombinedChartViewController.h b/ChartsDemo/Objective-C/Demos/CombinedChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/CombinedChartViewController.h rename to ChartsDemo/Objective-C/Demos/CombinedChartViewController.h diff --git a/ChartsDemo/Classes/Demos/CombinedChartViewController.m b/ChartsDemo/Objective-C/Demos/CombinedChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/CombinedChartViewController.m rename to ChartsDemo/Objective-C/Demos/CombinedChartViewController.m diff --git a/ChartsDemo/Classes/Demos/CubicLineChartViewController.h b/ChartsDemo/Objective-C/Demos/CubicLineChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/CubicLineChartViewController.h rename to ChartsDemo/Objective-C/Demos/CubicLineChartViewController.h diff --git a/ChartsDemo/Classes/Demos/CubicLineChartViewController.m b/ChartsDemo/Objective-C/Demos/CubicLineChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/CubicLineChartViewController.m rename to ChartsDemo/Objective-C/Demos/CubicLineChartViewController.m diff --git a/ChartsDemo/Classes/Demos/HalfPieChartViewController.h b/ChartsDemo/Objective-C/Demos/HalfPieChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/HalfPieChartViewController.h rename to ChartsDemo/Objective-C/Demos/HalfPieChartViewController.h diff --git a/ChartsDemo/Classes/Demos/HalfPieChartViewController.m b/ChartsDemo/Objective-C/Demos/HalfPieChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/HalfPieChartViewController.m rename to ChartsDemo/Objective-C/Demos/HalfPieChartViewController.m diff --git a/ChartsDemo/Classes/Demos/HorizontalBarChartViewController.h b/ChartsDemo/Objective-C/Demos/HorizontalBarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/HorizontalBarChartViewController.h rename to ChartsDemo/Objective-C/Demos/HorizontalBarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/HorizontalBarChartViewController.m b/ChartsDemo/Objective-C/Demos/HorizontalBarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/HorizontalBarChartViewController.m rename to ChartsDemo/Objective-C/Demos/HorizontalBarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/LineChart1ViewController.h b/ChartsDemo/Objective-C/Demos/LineChart1ViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/LineChart1ViewController.h rename to ChartsDemo/Objective-C/Demos/LineChart1ViewController.h diff --git a/ChartsDemo/Classes/Demos/LineChart1ViewController.m b/ChartsDemo/Objective-C/Demos/LineChart1ViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/LineChart1ViewController.m rename to ChartsDemo/Objective-C/Demos/LineChart1ViewController.m diff --git a/ChartsDemo/Classes/Demos/LineChart2ViewController.h b/ChartsDemo/Objective-C/Demos/LineChart2ViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/LineChart2ViewController.h rename to ChartsDemo/Objective-C/Demos/LineChart2ViewController.h diff --git a/ChartsDemo/Classes/Demos/LineChart2ViewController.m b/ChartsDemo/Objective-C/Demos/LineChart2ViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/LineChart2ViewController.m rename to ChartsDemo/Objective-C/Demos/LineChart2ViewController.m diff --git a/ChartsDemo/Classes/Demos/LineChartFilledViewController.h b/ChartsDemo/Objective-C/Demos/LineChartFilledViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/LineChartFilledViewController.h rename to ChartsDemo/Objective-C/Demos/LineChartFilledViewController.h diff --git a/ChartsDemo/Classes/Demos/LineChartFilledViewController.m b/ChartsDemo/Objective-C/Demos/LineChartFilledViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/LineChartFilledViewController.m rename to ChartsDemo/Objective-C/Demos/LineChartFilledViewController.m diff --git a/ChartsDemo/Classes/Demos/LineChartTimeViewController.h b/ChartsDemo/Objective-C/Demos/LineChartTimeViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/LineChartTimeViewController.h rename to ChartsDemo/Objective-C/Demos/LineChartTimeViewController.h diff --git a/ChartsDemo/Classes/Demos/LineChartTimeViewController.m b/ChartsDemo/Objective-C/Demos/LineChartTimeViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/LineChartTimeViewController.m rename to ChartsDemo/Objective-C/Demos/LineChartTimeViewController.m diff --git a/ChartsDemo/Classes/Demos/MultipleBarChartViewController.h b/ChartsDemo/Objective-C/Demos/MultipleBarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/MultipleBarChartViewController.h rename to ChartsDemo/Objective-C/Demos/MultipleBarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/MultipleBarChartViewController.m b/ChartsDemo/Objective-C/Demos/MultipleBarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/MultipleBarChartViewController.m rename to ChartsDemo/Objective-C/Demos/MultipleBarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/MultipleLinesChartViewController.h b/ChartsDemo/Objective-C/Demos/MultipleLinesChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/MultipleLinesChartViewController.h rename to ChartsDemo/Objective-C/Demos/MultipleLinesChartViewController.h diff --git a/ChartsDemo/Classes/Demos/MultipleLinesChartViewController.m b/ChartsDemo/Objective-C/Demos/MultipleLinesChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/MultipleLinesChartViewController.m rename to ChartsDemo/Objective-C/Demos/MultipleLinesChartViewController.m diff --git a/ChartsDemo/Classes/Demos/NegativeStackedBarChartViewController.h b/ChartsDemo/Objective-C/Demos/NegativeStackedBarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/NegativeStackedBarChartViewController.h rename to ChartsDemo/Objective-C/Demos/NegativeStackedBarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/NegativeStackedBarChartViewController.m b/ChartsDemo/Objective-C/Demos/NegativeStackedBarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/NegativeStackedBarChartViewController.m rename to ChartsDemo/Objective-C/Demos/NegativeStackedBarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/PieChartViewController.h b/ChartsDemo/Objective-C/Demos/PieChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/PieChartViewController.h rename to ChartsDemo/Objective-C/Demos/PieChartViewController.h diff --git a/ChartsDemo/Classes/Demos/PieChartViewController.m b/ChartsDemo/Objective-C/Demos/PieChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/PieChartViewController.m rename to ChartsDemo/Objective-C/Demos/PieChartViewController.m diff --git a/ChartsDemo/Classes/Demos/PiePolylineChartViewController.h b/ChartsDemo/Objective-C/Demos/PiePolylineChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/PiePolylineChartViewController.h rename to ChartsDemo/Objective-C/Demos/PiePolylineChartViewController.h diff --git a/ChartsDemo/Classes/Demos/PiePolylineChartViewController.m b/ChartsDemo/Objective-C/Demos/PiePolylineChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/PiePolylineChartViewController.m rename to ChartsDemo/Objective-C/Demos/PiePolylineChartViewController.m diff --git a/ChartsDemo/Classes/Demos/PositiveNegativeBarChartViewController.h b/ChartsDemo/Objective-C/Demos/PositiveNegativeBarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/PositiveNegativeBarChartViewController.h rename to ChartsDemo/Objective-C/Demos/PositiveNegativeBarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/PositiveNegativeBarChartViewController.m b/ChartsDemo/Objective-C/Demos/PositiveNegativeBarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/PositiveNegativeBarChartViewController.m rename to ChartsDemo/Objective-C/Demos/PositiveNegativeBarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/RadarChartViewController.h b/ChartsDemo/Objective-C/Demos/RadarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/RadarChartViewController.h rename to ChartsDemo/Objective-C/Demos/RadarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/RadarChartViewController.m b/ChartsDemo/Objective-C/Demos/RadarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/RadarChartViewController.m rename to ChartsDemo/Objective-C/Demos/RadarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/ScatterChartViewController.h b/ChartsDemo/Objective-C/Demos/ScatterChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/ScatterChartViewController.h rename to ChartsDemo/Objective-C/Demos/ScatterChartViewController.h diff --git a/ChartsDemo/Classes/Demos/ScatterChartViewController.m b/ChartsDemo/Objective-C/Demos/ScatterChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/ScatterChartViewController.m rename to ChartsDemo/Objective-C/Demos/ScatterChartViewController.m diff --git a/ChartsDemo/Classes/Demos/SinusBarChartViewController.h b/ChartsDemo/Objective-C/Demos/SinusBarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/SinusBarChartViewController.h rename to ChartsDemo/Objective-C/Demos/SinusBarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/SinusBarChartViewController.m b/ChartsDemo/Objective-C/Demos/SinusBarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/SinusBarChartViewController.m rename to ChartsDemo/Objective-C/Demos/SinusBarChartViewController.m diff --git a/ChartsDemo/Classes/Demos/StackedBarChartViewController.h b/ChartsDemo/Objective-C/Demos/StackedBarChartViewController.h similarity index 100% rename from ChartsDemo/Classes/Demos/StackedBarChartViewController.h rename to ChartsDemo/Objective-C/Demos/StackedBarChartViewController.h diff --git a/ChartsDemo/Classes/Demos/StackedBarChartViewController.m b/ChartsDemo/Objective-C/Demos/StackedBarChartViewController.m similarity index 100% rename from ChartsDemo/Classes/Demos/StackedBarChartViewController.m rename to ChartsDemo/Objective-C/Demos/StackedBarChartViewController.m diff --git a/ChartsDemo/Classes/Formatters/DateValueFormatter.h b/ChartsDemo/Objective-C/Formatters/DateValueFormatter.h similarity index 100% rename from ChartsDemo/Classes/Formatters/DateValueFormatter.h rename to ChartsDemo/Objective-C/Formatters/DateValueFormatter.h diff --git a/ChartsDemo/Classes/Formatters/DateValueFormatter.m b/ChartsDemo/Objective-C/Formatters/DateValueFormatter.m similarity index 100% rename from ChartsDemo/Classes/Formatters/DateValueFormatter.m rename to ChartsDemo/Objective-C/Formatters/DateValueFormatter.m diff --git a/ChartsDemo/Classes/Formatters/DayAxisValueFormatter.h b/ChartsDemo/Objective-C/Formatters/DayAxisValueFormatter.h similarity index 100% rename from ChartsDemo/Classes/Formatters/DayAxisValueFormatter.h rename to ChartsDemo/Objective-C/Formatters/DayAxisValueFormatter.h diff --git a/ChartsDemo/Classes/Formatters/DayAxisValueFormatter.m b/ChartsDemo/Objective-C/Formatters/DayAxisValueFormatter.m similarity index 100% rename from ChartsDemo/Classes/Formatters/DayAxisValueFormatter.m rename to ChartsDemo/Objective-C/Formatters/DayAxisValueFormatter.m diff --git a/ChartsDemo/Classes/Formatters/IntAxisValueFormatter.h b/ChartsDemo/Objective-C/Formatters/IntAxisValueFormatter.h similarity index 100% rename from ChartsDemo/Classes/Formatters/IntAxisValueFormatter.h rename to ChartsDemo/Objective-C/Formatters/IntAxisValueFormatter.h diff --git a/ChartsDemo/Classes/Formatters/IntAxisValueFormatter.m b/ChartsDemo/Objective-C/Formatters/IntAxisValueFormatter.m similarity index 100% rename from ChartsDemo/Classes/Formatters/IntAxisValueFormatter.m rename to ChartsDemo/Objective-C/Formatters/IntAxisValueFormatter.m diff --git a/ChartsDemo/Classes/Formatters/LargeValueFormatter.swift b/ChartsDemo/Objective-C/Formatters/LargeValueFormatter.swift similarity index 100% rename from ChartsDemo/Classes/Formatters/LargeValueFormatter.swift rename to ChartsDemo/Objective-C/Formatters/LargeValueFormatter.swift diff --git a/ChartsDemo/Resources/Images.xcassets/AppIcon.appiconset/Contents.json b/ChartsDemo/Resources/Images.xcassets/AppIcon.appiconset/Contents.json index 6568fb7f37..7c780dbcb5 100644 --- a/ChartsDemo/Resources/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/ChartsDemo/Resources/Images.xcassets/AppIcon.appiconset/Contents.json @@ -57,4 +57,4 @@ "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/ChartsDemo/Swift/AppDelegate.swift b/ChartsDemo/Swift/AppDelegate.swift new file mode 100644 index 0000000000..7f13108e70 --- /dev/null +++ b/ChartsDemo/Swift/AppDelegate.swift @@ -0,0 +1,54 @@ +// +// AppDelegate.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-03. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + self.window = UIWindow(frame: UIScreen.main.bounds) + + + let vc = DemoListViewController() + let nav = UINavigationController(rootViewController: vc) + + window?.rootViewController = nav + window?.makeKeyAndVisible() + + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // 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. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // 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. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/ChartsDemo/Swift/Components/BalloonMarker.swift b/ChartsDemo/Swift/Components/BalloonMarker.swift new file mode 100644 index 0000000000..d18b3d2823 --- /dev/null +++ b/ChartsDemo/Swift/Components/BalloonMarker.swift @@ -0,0 +1,122 @@ +// +// BalloonMarker.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import Foundation +import Charts + +public class BalloonMarker: MarkerImage { + public var color: UIColor + public var arrowSize = CGSize(width: 15, height: 11) + public var font: UIFont + public var textColor: UIColor + public var insets: UIEdgeInsets + public var minimumSize = CGSize() + + fileprivate var label: String? + fileprivate var _labelSize: CGSize = CGSize() + fileprivate var _paragraphStyle: NSMutableParagraphStyle? + fileprivate var _drawAttributes = [NSAttributedStringKey : AnyObject]() + + public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets) { + self.color = color + self.font = font + self.textColor = textColor + self.insets = insets + + _paragraphStyle = NSParagraphStyle.default.mutableCopy() as? NSMutableParagraphStyle + _paragraphStyle?.alignment = .center + super.init() + } + + public override func offsetForDrawing(atPoint point: CGPoint) -> CGPoint { + let size = self.size + var point = point + point.x -= size.width / 2.0 + point.y -= size.height + return super.offsetForDrawing(atPoint: point) + } + + public override func draw(context: CGContext, point: CGPoint) { + guard let label = label else { return } + + let offset = self.offsetForDrawing(atPoint: point) + let size = self.size + + var rect = CGRect( + origin: CGPoint( + x: point.x + offset.x, + y: point.y + offset.y), + size: size) + rect.origin.x -= size.width / 2.0 + rect.origin.y -= size.height + + context.saveGState() + + context.setFillColor(color.cgColor) + context.beginPath() + context.move(to: CGPoint( + x: rect.origin.x, + y: rect.origin.y)) + context.addLine(to: CGPoint( + x: rect.origin.x + rect.size.width, + y: rect.origin.y)) + context.addLine(to: CGPoint( + x: rect.origin.x + rect.size.width, + y: rect.origin.y + rect.size.height - arrowSize.height)) + context.addLine(to: CGPoint( + x: rect.origin.x + (rect.size.width + arrowSize.width) / 2.0, + y: rect.origin.y + rect.size.height - arrowSize.height)) + context.addLine(to: CGPoint( + x: rect.origin.x + rect.size.width / 2.0, + y: rect.origin.y + rect.size.height)) + context.addLine(to: CGPoint( + x: rect.origin.x + (rect.size.width - arrowSize.width) / 2.0, + y: rect.origin.y + rect.size.height - arrowSize.height)) + context.addLine(to: CGPoint( + x: rect.origin.x, + y: rect.origin.y + rect.size.height - arrowSize.height)) + context.addLine(to: CGPoint( + x: rect.origin.x, + y: rect.origin.y)) + context.fillPath() + + rect.origin.y += self.insets.top + rect.size.height -= self.insets.top + self.insets.bottom + + UIGraphicsPushContext(context) + + label.draw(in: rect, withAttributes: _drawAttributes) + + UIGraphicsPopContext() + + context.restoreGState() + } + + public override func refreshContent(entry: ChartDataEntry, highlight: Highlight) { + setLabel(String(entry.y)) + } + + public func setLabel(_ newLabel: String) { + label = newLabel + + _drawAttributes.removeAll() + _drawAttributes[.font] = self.font + _drawAttributes[.paragraphStyle] = _paragraphStyle + _drawAttributes[.foregroundColor] = self.textColor + + _labelSize = label?.size(withAttributes: _drawAttributes) ?? CGSize.zero + + var size = CGSize() + size.width = _labelSize.width + self.insets.left + self.insets.right + size.height = _labelSize.height + self.insets.top + self.insets.bottom + size.width = max(minimumSize.width, size.width) + size.height = max(minimumSize.height, size.height) + self.size = size + } + +} diff --git a/ChartsDemo/Swift/Components/RadarMarkerView.swift b/ChartsDemo/Swift/Components/RadarMarkerView.swift new file mode 100644 index 0000000000..019196d5e8 --- /dev/null +++ b/ChartsDemo/Swift/Components/RadarMarkerView.swift @@ -0,0 +1,27 @@ +// +// RadarMarkerView.swift +// ChartsDemo +// +// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda +// A port of MPAndroidChart for iOS +// Licensed under Apache License 2.0 +// +// https://github.com/danielgindi/Charts +// + +import Foundation +import Charts + +public class RadarMarkerView: MarkerView { + @IBOutlet var label: UILabel! + + public override func awakeFromNib() { + self.offset.x = -self.frame.size.width / 2.0 + self.offset.y = -self.frame.size.height - 7.0 + } + + public override func refreshContent(entry: ChartDataEntry, highlight: Highlight) { + label.text = String.init(format: "%d %%", Int(round(entry.y))) + layoutIfNeeded() + } +} diff --git a/ChartsDemo/Swift/Components/XYMarkerView.swift b/ChartsDemo/Swift/Components/XYMarkerView.swift new file mode 100644 index 0000000000..23bb965487 --- /dev/null +++ b/ChartsDemo/Swift/Components/XYMarkerView.swift @@ -0,0 +1,32 @@ +// +// XYMarkerView.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import Foundation +import Charts + +public class XYMarkerView: BalloonMarker { + public var xAxisValueFormatter: IAxisValueFormatter + fileprivate var yFormatter = NumberFormatter() + + public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets, + xAxisValueFormatter: IAxisValueFormatter) { + self.xAxisValueFormatter = xAxisValueFormatter + yFormatter.minimumFractionDigits = 1 + yFormatter.maximumFractionDigits = 1 + super.init(color: color, font: font, textColor: textColor, insets: insets) + } + + public override func refreshContent(entry: ChartDataEntry, highlight: Highlight) { + let string = "x: " + + xAxisValueFormatter.stringForValue(entry.x, axis: XAxis()) + + ", y: " + + yFormatter.string(from: NSNumber(floatLiteral: entry.y))! + setLabel(string) + } + +} diff --git a/ChartsDemo/Swift/DemoBaseViewController.swift b/ChartsDemo/Swift/DemoBaseViewController.swift new file mode 100644 index 0000000000..c19c174ee9 --- /dev/null +++ b/ChartsDemo/Swift/DemoBaseViewController.swift @@ -0,0 +1,362 @@ +// +// DemoBaseViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-03. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +enum Option { + case toggleValues + case toggleIcons + case toggleHighlight + case animateX + case animateY + case animateXY + case saveToGallery + case togglePinchZoom + case toggleAutoScaleMinMax + case toggleData + case toggleBarBorders + // CandleChart + case toggleShadowColorSameAsCandle + // CombinedChart + case toggleLineValues + case toggleBarValues + case removeDataSet + // CubicLineSampleFillFormatter + case toggleFilled + case toggleCircles + case toggleCubic + case toggleHorizontalCubic + case toggleStepped + // HalfPieChartController + case toggleXValues + case togglePercent + case toggleHole + case spin + case drawCenter + // RadarChart + case toggleXLabels + case toggleYLabels + case toggleRotate + case toggleHighlightCircle + + var label: String { + switch self { + case .toggleValues: return "Toggle Y-Values" + case .toggleIcons: return "Toggle Icons" + case .toggleHighlight: return "Toggle Highlight" + case .animateX: return "Animate X" + case .animateY: return "Animate Y" + case .animateXY: return "Animate XY" + case .saveToGallery: return "Save to Camera Roll" + case .togglePinchZoom: return "Toggle PinchZoom" + case .toggleAutoScaleMinMax: return "Toggle auto scale min/max" + case .toggleData: return "Toggle Data" + case .toggleBarBorders: return "Toggle Bar Borders" + // CandleChart + case .toggleShadowColorSameAsCandle: return "Toggle shadow same color" + // CombinedChart + case .toggleLineValues: return "Toggle Line Values" + case .toggleBarValues: return "Toggle Bar Values" + case .removeDataSet: return "Remove Random Set" + // CubicLineSampleFillFormatter + case .toggleFilled: return "Toggle Filled" + case .toggleCircles: return "Toggle Circles" + case .toggleCubic: return "Toggle Cubic" + case .toggleHorizontalCubic: return "Toggle Horizontal Cubic" + case .toggleStepped: return "Toggle Stepped" + // HalfPieChartController + case .toggleXValues: return "Toggle X-Values" + case .togglePercent: return "Toggle Percent" + case .toggleHole: return "Toggle Hole" + case .spin: return "Spin" + case .drawCenter: return "Draw CenterText" + // RadarChart + case .toggleXLabels: return "Toggle X-Labels" + case .toggleYLabels: return "Toggle Y-Labels" + case .toggleRotate: return "Toggle Rotate" + case .toggleHighlightCircle: return "Toggle highlight circle" + } + } +} + +class DemoBaseViewController: UIViewController, ChartViewDelegate { + private var optionsTableView: UITableView? = nil + let parties = ["Party A", "Party B", "Party C", "Party D", "Party E", "Party F", + "Party G", "Party H", "Party I", "Party J", "Party K", "Party L", + "Party M", "Party N", "Party O", "Party P", "Party Q", "Party R", + "Party S", "Party T", "Party U", "Party V", "Party W", "Party X", + "Party Y", "Party Z"] + + @IBOutlet weak var optionsButton: UIButton! + var options: [Option]! + + var shouldHideData: Bool = false + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + self.initialize() + } + + override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { + super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) + self.initialize() + } + + private func initialize() { + self.edgesForExtendedLayout = [] + } + + func optionTapped(_ option: Option) {} + + func handleOption(_ option: Option, forChartView chartView: ChartViewBase) { + switch option { + case .toggleValues: + for set in chartView.data!.dataSets { + set.drawValuesEnabled = !set.drawValuesEnabled + } + chartView.setNeedsDisplay() + + case .toggleIcons: + for set in chartView.data!.dataSets { + set.drawIconsEnabled = !set.drawIconsEnabled + } + chartView.setNeedsDisplay() + + case .toggleHighlight: + chartView.data!.highlightEnabled = !chartView.data!.isHighlightEnabled + chartView.setNeedsDisplay() + + case .animateX: + chartView.animate(xAxisDuration: 3) + + case .animateY: + chartView.animate(yAxisDuration: 3) + + case .animateXY: + chartView.animate(xAxisDuration: 3, yAxisDuration: 3) + + case .saveToGallery: + UIImageWriteToSavedPhotosAlbum(chartView.getChartImage(transparent: false)!, nil, nil, nil) + + case .togglePinchZoom: + let barLineChart = chartView as! BarLineChartViewBase + barLineChart.pinchZoomEnabled = !barLineChart.pinchZoomEnabled + chartView.setNeedsDisplay() + + case .toggleAutoScaleMinMax: + let barLineChart = chartView as! BarLineChartViewBase + barLineChart.autoScaleMinMaxEnabled = !barLineChart.isAutoScaleMinMaxEnabled + chartView.notifyDataSetChanged() + + case .toggleData: + shouldHideData = !shouldHideData + updateChartData() + + case .toggleBarBorders: + for set in chartView.data!.dataSets { + if let set = set as? BarChartDataSet { + set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0 + } + } + chartView.setNeedsDisplay() + default: + break + } + } + + @IBAction func optionsButtonTapped(_ sender: Any) { + if let optionsTableView = self.optionsTableView { + optionsTableView.removeFromSuperview() + self.optionsTableView = nil + return + } + + let optionsTableView = UITableView() + optionsTableView.backgroundColor = UIColor(white: 0, alpha: 0.9) + optionsTableView.delegate = self + optionsTableView.dataSource = self + + optionsTableView.translatesAutoresizingMaskIntoConstraints = false + + self.optionsTableView = optionsTableView + + var constraints = [NSLayoutConstraint]() + + constraints.append(NSLayoutConstraint(item: optionsTableView, + attribute: .leading, + relatedBy: .equal, + toItem: self.view, + attribute: .leading, + multiplier: 1, + constant: 40)) + + constraints.append(NSLayoutConstraint(item: optionsTableView, + attribute: .trailing, + relatedBy: .equal, + toItem: sender as! UIView, + attribute: .trailing, + multiplier: 1, + constant: 0)) + + constraints.append(NSLayoutConstraint(item: optionsTableView, + attribute: .top, + relatedBy: .equal, + toItem: sender, + attribute: .bottom, + multiplier: 1, + constant: 5)) + + self.view.addSubview(optionsTableView) + constraints.forEach { $0.isActive = true } + + let constraint = NSLayoutConstraint(item: optionsTableView, + attribute: .height, + relatedBy: .equal, + toItem: nil, + attribute: .height, + multiplier: 1, + constant: 220) + constraint.isActive = true + } + + func updateChartData() { + fatalError("updateChartData not overridden") + } + + func setup(pieChartView chartView: PieChartView) { + chartView.usePercentValuesEnabled = true + chartView.drawSlicesUnderHoleEnabled = false + chartView.holeRadiusPercent = 0.58 + chartView.transparentCircleRadiusPercent = 0.61 + chartView.chartDescription?.enabled = false + chartView.setExtraOffsets(left: 5, top: 10, right: 5, bottom: 5) + + chartView.drawCenterTextEnabled = true + + let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle + paragraphStyle.lineBreakMode = .byTruncatingTail + paragraphStyle.alignment = .center + + let centerText = NSMutableAttributedString(string: "Charts\nby Daniel Cohen Gindi") + centerText.setAttributes([.font : UIFont(name: "HelveticaNeue-Light", size: 13)!, + .paragraphStyle : paragraphStyle], range: NSRange(location: 0, length: centerText.length)) + centerText.addAttributes([.font : UIFont(name: "HelveticaNeue-Light", size: 11)!, + .foregroundColor : UIColor.gray], range: NSRange(location: 10, length: centerText.length - 10)) + centerText.addAttributes([.font : UIFont(name: "HelveticaNeue-Light", size: 11)!, + .foregroundColor : UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)], range: NSRange(location: centerText.length - 19, length: 19)) + chartView.centerAttributedText = centerText; + + chartView.drawHoleEnabled = true + chartView.rotationAngle = 0 + chartView.rotationEnabled = true + chartView.highlightPerTapEnabled = true + + let l = chartView.legend + l.horizontalAlignment = .right + l.verticalAlignment = .top + l.orientation = .vertical + l.drawInside = false + l.xEntrySpace = 7 + l.yEntrySpace = 0 + l.yOffset = 0 +// chartView.legend = l + } + + func setup(radarChartView chartView: RadarChartView) { + chartView.chartDescription?.enabled = false + } + + func setup(barLineChartView chartView: BarLineChartViewBase) { + chartView.chartDescription?.enabled = false + + chartView.dragEnabled = true + chartView.setScaleEnabled(true) + chartView.pinchZoomEnabled = false + + // ChartYAxis *leftAxis = chartView.leftAxis; + + let xAxis = chartView.xAxis + xAxis.labelPosition = .bottom + + chartView.rightAxis.enabled = false + } + // TODO: Cannot override from extensions + //extension DemoBaseViewController: ChartViewDelegate { + func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) { + NSLog("chartValueSelected"); + } + + func chartValueNothingSelected(_ chartView: ChartViewBase) { + NSLog("chartValueNothingSelected"); + } + + func chartScaled(_ chartView: ChartViewBase, scaleX: CGFloat, scaleY: CGFloat) { + + } + + func chartTranslated(_ chartView: ChartViewBase, dX: CGFloat, dY: CGFloat) { + + } +} + +extension DemoBaseViewController: UITableViewDelegate, UITableViewDataSource { + func numberOfSections(in tableView: UITableView) -> Int { + if optionsTableView != nil { + return 1 + } + + return 0 + } + + @available(iOS 2.0, *) + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + if optionsTableView != nil { + return options.count + } + + return 0 + + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + if optionsTableView != nil { + return 40.0; + } + + return 44.0; + } + + @available(iOS 2.0, *) + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + var cell = tableView.dequeueReusableCell(withIdentifier: "Cell") + + if cell == nil { + cell = UITableViewCell(style: .default, reuseIdentifier: "Cell") + cell?.backgroundView = nil + cell?.backgroundColor = .clear + cell?.textLabel?.textColor = .white + } + cell?.textLabel?.text = self.options[indexPath.row].label + + return cell! + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + if optionsTableView != nil { + tableView.deselectRow(at: indexPath, animated: true) + + optionsTableView?.removeFromSuperview() + self.optionsTableView = nil + + self.optionTapped(self.options[indexPath.row]) + } + + } +} + diff --git a/ChartsDemo/Swift/DemoListViewController.swift b/ChartsDemo/Swift/DemoListViewController.swift new file mode 100644 index 0000000000..1322e488cb --- /dev/null +++ b/ChartsDemo/Swift/DemoListViewController.swift @@ -0,0 +1,129 @@ +// +// DemoListViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit + +private struct ItemDef { + let title: String + let subtitle: String + let `class`: AnyClass +} + +class DemoListViewController: UIViewController { + + @IBOutlet var tableView: UITableView! + private var itemDefs = [ItemDef(title: "Line Chart", + subtitle: "A simple demonstration of the linechart.", + class: LineChart1ViewController.self), + ItemDef(title: "Line Chart (Dual YAxis)", + subtitle: "Demonstration of the linechart with dual y-axis.", + class: LineChart2ViewController.self), + ItemDef(title: "Bar Chart", + subtitle: "A simple demonstration of the bar chart.", + class: BarChartViewController.self), + ItemDef(title: "Horizontal Bar Chart", + subtitle: "A simple demonstration of the horizontal bar chart.", + class: HorizontalBarChartViewController.self), + ItemDef(title: "Combined Chart", + subtitle: "Demonstrates how to create a combined chart (bar and line in this case).", + class: CombinedChartViewController.self), + ItemDef(title: "Pie Chart", + subtitle: "A simple demonstration of the pie chart.", + class: PieChartViewController.self), + ItemDef(title: "Pie Chart with value lines", + subtitle: "A simple demonstration of the pie chart with polyline notes.", + class: PiePolylineChartViewController.self), + ItemDef(title: "Scatter Chart", + subtitle: "A simple demonstration of the scatter chart.", + class: ScatterChartViewController.self), + ItemDef(title: "Bubble Chart", + subtitle: "A simple demonstration of the bubble chart.", + class: BubbleChartViewController.self), + ItemDef(title: "Stacked Bar Chart", + subtitle: "A simple demonstration of a bar chart with stacked bars.", + class: StackedBarChartViewController.self), + ItemDef(title: "Stacked Bar Chart Negative", + subtitle: "A simple demonstration of stacked bars with negative and positive values.", + class: NegativeStackedBarChartViewController.self), + ItemDef(title: "Another Bar Chart", + subtitle: "Implementation of a BarChart that only shows values at the bottom.", + class: AnotherBarChartViewController.self), + ItemDef(title: "Multiple Lines Chart", + subtitle: "A line chart with multiple DataSet objects. One color per DataSet.", + class: MultipleLinesChartViewController.self), + ItemDef(title: "Multiple Bars Chart", + subtitle: "A bar chart with multiple DataSet objects. One multiple colors per DataSet.", + class: MultipleBarChartViewController.self), + ItemDef(title: "Candle Stick Chart", + subtitle: "Demonstrates usage of the CandleStickChart.", + class: CandleStickChartViewController.self), + ItemDef(title: "Cubic Line Chart", + subtitle: "Demonstrates cubic lines in a LineChart.", + class: CubicLineChartViewController.self), + ItemDef(title: "Radar Chart", + subtitle: "Demonstrates the use of a spider-web like (net) chart.", + class: RadarChartViewController.self), + ItemDef(title: "Colored Line Chart", + subtitle: "Shows a LineChart with different background and line color.", + class: ColoredLineChartViewController.self), + ItemDef(title: "Sinus Bar Chart", + subtitle: "A Bar Chart plotting the sinus function with 8.000 values.", + class: SinusBarChartViewController.self), + ItemDef(title: "BarChart positive / negative", + subtitle: "This demonstrates how to create a BarChart with positive and negative values in different colors.", + class: PositiveNegativeBarChartViewController.self), + ItemDef(title: "Time Line Chart", + subtitle: "Simple demonstration of a time-chart. This chart draws one line entry per hour originating from the current time in milliseconds.", + class: LineChartTimeViewController.self), + ItemDef(title: "Filled Line Chart", + subtitle: "This demonstrates how to fill an area between two LineDataSets.", + class: LineChartFilledViewController.self), + ItemDef(title: "Half Pie Chart", + subtitle: "This demonstrates how to create a 180 degree PieChart.", + class: HalfPieChartViewController.self) + ] + + override func viewDidLoad() { + super.viewDidLoad() + + self.title = "Charts Demonstration" + self.tableView.rowHeight = 70 + //FIXME: Add TimeLineChart + + } +} + +extension DemoListViewController: UITableViewDelegate, UITableViewDataSource { + func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return self.itemDefs.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let def = self.itemDefs[indexPath.row] + let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") ?? UITableViewCell(style: .subtitle, reuseIdentifier: "Cell") + cell.textLabel?.text = def.title + cell.detailTextLabel?.text = def.subtitle + cell.detailTextLabel?.numberOfLines = 0 + + return cell + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let def = self.itemDefs[indexPath.row] + + let vcClass = def.class as! UIViewController.Type + let vc = vcClass.init() + + self.navigationController?.pushViewController(vc, animated: true) + tableView.deselectRow(at: indexPath, animated: true) + } +} diff --git a/ChartsDemo/Swift/Demos/AnotherBarChartViewController.swift b/ChartsDemo/Swift/Demos/AnotherBarChartViewController.swift new file mode 100644 index 0000000000..abe86cd94a --- /dev/null +++ b/ChartsDemo/Swift/Demos/AnotherBarChartViewController.swift @@ -0,0 +1,98 @@ +// +// AnotherBarChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class AnotherBarChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: BarChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.options = [.toggleValues, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleData, + .toggleBarBorders] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + chartView.maxVisibleCount = 60 + chartView.pinchZoomEnabled = false + chartView.drawBarShadowEnabled = false + + let xAxis = chartView.xAxis + xAxis.labelPosition = .bottom + + chartView.legend.enabled = false + + sliderX.value = 10 + sliderY.value = 100 + self.slidersValueChanged(nil) + } + + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value) + 1, range: Double(sliderY.value)) + } + + func setDataCount(_ count: Int, range: Double) { + let yVals = (0.. BarChartDataEntry in + let mult = range + 1 + let val = Double(arc4random_uniform(UInt32(mult))) + mult/3 + return BarChartDataEntry(x: Double(i), y: val) + } + + var set1: BarChartDataSet! = nil + if let set = chartView.data?.dataSets.first as? BarChartDataSet { + set1 = set + set1?.values = yVals + chartView.data?.notifyDataChanged() + chartView.notifyDataSetChanged() + } else { + set1 = BarChartDataSet(values: yVals, label: "Data Set") + set1.colors = ChartColorTemplates.vordiplom() + set1.drawValuesEnabled = false + + let data = BarChartData(dataSet: set1) + chartView.data = data + chartView.fitBars = true + } + + chartView.setNeedsDisplay() + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/BarChartViewController.swift b/ChartsDemo/Swift/Demos/BarChartViewController.swift new file mode 100644 index 0000000000..a9a629120a --- /dev/null +++ b/ChartsDemo/Swift/Demos/BarChartViewController.swift @@ -0,0 +1,152 @@ +// +// BarChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class BarChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: BarChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Bar Chart" + + self.options = [.toggleValues, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleData, + .toggleBarBorders] + + self.setup(barLineChartView: chartView) + + chartView.delegate = self + + chartView.drawBarShadowEnabled = false + chartView.drawValueAboveBarEnabled = false + + chartView.maxVisibleCount = 60 + + let xAxis = chartView.xAxis + xAxis.labelPosition = .bottom + xAxis.labelFont = .systemFont(ofSize: 10) + xAxis.granularity = 1 + xAxis.labelCount = 7 + xAxis.valueFormatter = DayAxisValueFormatter(chart: chartView) + + let leftAxisFormatter = NumberFormatter() + leftAxisFormatter.minimumFractionDigits = 0 + leftAxisFormatter.maximumFractionDigits = 1 + leftAxisFormatter.negativeSuffix = " $" + leftAxisFormatter.positiveSuffix = " $" + + let leftAxis = chartView.leftAxis + leftAxis.labelFont = .systemFont(ofSize: 10) + leftAxis.labelCount = 8 + leftAxis.valueFormatter = DefaultAxisValueFormatter(formatter: leftAxisFormatter) + leftAxis.labelPosition = .outsideChart + leftAxis.spaceTop = 0.15 + leftAxis.axisMinimum = 0 // FIXME: HUH?? this replaces startAtZero = YES + + let rightAxis = chartView.rightAxis + rightAxis.enabled = true + rightAxis.labelFont = .systemFont(ofSize: 10) + rightAxis.labelCount = 8 + rightAxis.valueFormatter = leftAxis.valueFormatter + rightAxis.spaceTop = 0.15 + rightAxis.axisMinimum = 0 + + let l = chartView.legend + l.horizontalAlignment = .left + l.verticalAlignment = .bottom + l.orientation = .horizontal + l.drawInside = false + l.form = .circle + l.formSize = 9 + l.font = UIFont(name: "HelveticaNeue-Light", size: 11)! + l.xEntrySpace = 4 +// chartView.legend = l + + let marker = XYMarkerView(color: UIColor(white: 180/250, alpha: 1), + font: .systemFont(ofSize: 12), + textColor: .white, + insets: UIEdgeInsets(top: 8, left: 8, bottom: 20, right: 8), + xAxisValueFormatter: chartView.xAxis.valueFormatter!) + marker.chartView = chartView + marker.minimumSize = CGSize(width: 80, height: 40) + chartView.marker = marker + + sliderX.value = 12 + sliderY.value = 50 + slidersValueChanged(nil) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value) + 1, range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let start = 1 + + let yVals = (start.. BarChartDataEntry in + let mult = range + 1 + let val = Double(arc4random_uniform(mult)) + if arc4random_uniform(100) < 25 { + return BarChartDataEntry(x: Double(i), y: val, icon: UIImage(named: "icon")) + } else { + return BarChartDataEntry(x: Double(i), y: val) + } + } + + var set1: BarChartDataSet! = nil + if let set = chartView.data?.dataSets.first as? BarChartDataSet { + set1 = set + set1.values = yVals + chartView.data?.notifyDataChanged() + chartView.notifyDataSetChanged() + } else { + set1 = BarChartDataSet(values: yVals, label: "The year 2017") + set1.colors = ChartColorTemplates.material() + set1.drawValuesEnabled = false + + let data = BarChartData(dataSet: set1) + data.setValueFont(UIFont(name: "HelveticaNeue-Light", size: 10)!) + data.barWidth = 0.9 + chartView.data = data + } + +// chartView.setNeedsDisplay() + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value + 2))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/BubbleChartViewController.swift b/ChartsDemo/Swift/Demos/BubbleChartViewController.swift new file mode 100644 index 0000000000..61d944b735 --- /dev/null +++ b/ChartsDemo/Swift/Demos/BubbleChartViewController.swift @@ -0,0 +1,127 @@ +// +// BubbleChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class BubbleChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: BubbleChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Bubble Chart" + self.options = [.toggleValues, + .toggleIcons, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.dragEnabled = false + chartView.setScaleEnabled(true) + chartView.maxVisibleCount = 200 + chartView.pinchZoomEnabled = true + + chartView.legend.horizontalAlignment = .right + chartView.legend.verticalAlignment = .top + chartView.legend.orientation = .vertical + chartView.legend.drawInside = false + chartView.legend.font = UIFont(name: "HelveticaNeue-Light", size: 10)! + + chartView.leftAxis.labelFont = UIFont(name: "HelveticaNeue-Light", size: 10)! + chartView.leftAxis.spaceTop = 0.3 + chartView.leftAxis.spaceBottom = 0.3 + chartView.leftAxis.axisMinimum = 0 + + chartView.rightAxis.enabled = false + + chartView.xAxis.labelPosition = .bottom + chartView.xAxis.labelFont = UIFont(name: "HelveticaNeue-Light", size: 10)! + + sliderX.value = 10 + sliderY.value = 50 + slidersValueChanged(nil) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let yVals1 = (0.. BubbleChartDataEntry in + let val = Double(arc4random_uniform(range)) + let size = CGFloat(arc4random_uniform(range)) + return BubbleChartDataEntry(x: Double(i), y: val, size: size, icon: UIImage(named: "icon")) + } + let yVals2 = (0.. BubbleChartDataEntry in + let val = Double(arc4random_uniform(range)) + let size = CGFloat(arc4random_uniform(range)) + return BubbleChartDataEntry(x: Double(i), y: val, size: size, icon: UIImage(named: "icon")) + } + let yVals3 = (0.. BubbleChartDataEntry in + let val = Double(arc4random_uniform(range)) + let size = CGFloat(arc4random_uniform(range)) + return BubbleChartDataEntry(x: Double(i), y: val, size: size) + } + + let set1 = BubbleChartDataSet(values: yVals1, label: "DS 1") + set1.drawIconsEnabled = false + set1.setColor(ChartColorTemplates.colorful()[0], alpha: 0.5) + set1.drawValuesEnabled = true + + let set2 = BubbleChartDataSet(values: yVals2, label: "DS 2") + set2.drawIconsEnabled = false + set2.iconsOffset = CGPoint(x: 0, y: 15) + set2.setColor(ChartColorTemplates.colorful()[1], alpha: 0.5) + set2.drawValuesEnabled = true + + let set3 = BubbleChartDataSet(values: yVals3, label: "DS 3") + set3.setColor(ChartColorTemplates.colorful()[2], alpha: 0.5) + set3.drawValuesEnabled = true + + let data = BubbleChartData(dataSets: [set1, set2, set3]) + data.setDrawValues(false) + data.setValueFont(UIFont(name: "HelveticaNeue-Light", size: 7)!) + data.setHighlightCircleWidth(1.5) + data.setValueTextColor(.white) + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/CandleStickChartViewController.swift b/ChartsDemo/Swift/Demos/CandleStickChartViewController.swift new file mode 100644 index 0000000000..082ba9d269 --- /dev/null +++ b/ChartsDemo/Swift/Demos/CandleStickChartViewController.swift @@ -0,0 +1,122 @@ +// +// CandleStickChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class CandleStickChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: CandleStickChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Bubble Chart" + self.options = [.toggleValues, + .toggleIcons, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleShadowColorSameAsCandle, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.dragEnabled = false + chartView.setScaleEnabled(true) + chartView.maxVisibleCount = 200 + chartView.pinchZoomEnabled = true + + chartView.legend.horizontalAlignment = .right + chartView.legend.verticalAlignment = .top + chartView.legend.orientation = .vertical + chartView.legend.drawInside = false + chartView.legend.font = UIFont(name: "HelveticaNeue-Light", size: 10)! + + chartView.leftAxis.labelFont = UIFont(name: "HelveticaNeue-Light", size: 10)! + chartView.leftAxis.spaceTop = 0.3 + chartView.leftAxis.spaceBottom = 0.3 + chartView.leftAxis.axisMinimum = 0 + + chartView.rightAxis.enabled = false + + chartView.xAxis.labelPosition = .bottom + chartView.xAxis.labelFont = UIFont(name: "HelveticaNeue-Light", size: 10)! + + sliderX.value = 10 + sliderY.value = 50 + slidersValueChanged(nil) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let yVals1 = (0.. CandleChartDataEntry in + let mult = range + 1 + let val = Double(arc4random_uniform(40) + mult) + let high = Double(arc4random_uniform(9) + 8) + let low = Double(arc4random_uniform(9) + 8) + let open = Double(arc4random_uniform(6) + 1) + let close = Double(arc4random_uniform(6) + 1) + let even = i % 2 == 0 + + return CandleChartDataEntry(x: Double(i), shadowH: val + high, shadowL: val - low, open: even ? val + open : val - open, close: even ? val - close : val + close, icon: UIImage(named: "icon")!) + } + + let set1 = CandleChartDataSet(values: yVals1, label: "Data Set") + set1.axisDependency = .left + set1.setColor(UIColor(white: 80/255, alpha: 1)) + set1.drawIconsEnabled = false + set1.shadowColor = .darkGray + set1.shadowWidth = 0.7 + set1.decreasingColor = .red + set1.decreasingFilled = true + set1.increasingColor = UIColor(red: 122/255, green: 242/255, blue: 84/255, alpha: 1) + set1.increasingFilled = false + set1.neutralColor = .blue + + let data = CandleChartData(dataSet: set1) + chartView.data = data + } + + override func optionTapped(_ option: Option) { + if .toggleShadowColorSameAsCandle ~= option { + for set in chartView.data!.dataSets as! [CandleChartDataSet] { + set.shadowColorSameAsCandle = !set.shadowColorSameAsCandle + } + chartView.notifyDataSetChanged() + } else { + super.handleOption(option, forChartView: chartView) + } + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + }} diff --git a/ChartsDemo/Swift/Demos/ColoredLineChartViewController.swift b/ChartsDemo/Swift/Demos/ColoredLineChartViewController.swift new file mode 100644 index 0000000000..a5309ea707 --- /dev/null +++ b/ChartsDemo/Swift/Demos/ColoredLineChartViewController.swift @@ -0,0 +1,77 @@ +// +// ColoredLineChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-04. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class ColoredLineChartViewController: DemoBaseViewController { + @IBOutlet var chartViews: [LineChartView]! + + override func viewDidLoad() { + super.viewDidLoad() + + self.title = "Colored Line Chart" + + let colors = [UIColor(red: 137/255, green: 230/255, blue: 81/255, alpha: 1), + UIColor(red: 240/255, green: 240/255, blue: 30/255, alpha: 1), + UIColor(red: 89/255, green: 199/255, blue: 250/255, alpha: 1), + UIColor(red: 250/255, green: 104/255, blue: 104/255, alpha: 1)] + + for (i, chartView) in chartViews.enumerated() { + let data = dataWithCount(36, range: 100) + data.setValueFont(UIFont(name: "HelveticaNeue", size: 7)!) + + setupChart(chartView, data: data, color: colors[i % colors.count]) + } + } + + func setupChart(_ chart: LineChartView, data: LineChartData, color: UIColor) { + (data.getDataSetByIndex(0) as! LineChartDataSet).circleHoleColor = color + + chart.delegate = self + chart.backgroundColor = color + + chart.chartDescription?.enabled = false + + chart.dragEnabled = true + chart.setScaleEnabled(true) + chart.pinchZoomEnabled = false + chart.setViewPortOffsets(left: 10, top: 0, right: 10, bottom: 0) + + chart.legend.enabled = false + + chart.leftAxis.enabled = false + chart.leftAxis.spaceTop = 0.4 + chart.leftAxis.spaceBottom = 0.4 + chart.rightAxis.enabled = false + chart.xAxis.enabled = false + + chart.data = data + + chart.animate(xAxisDuration: 2.5) + } + + func dataWithCount(_ count: Int, range: UInt32) -> LineChartData { + let yVals = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range)) + 3 + return ChartDataEntry(x: Double(i), y: val) + } + + let set1 = LineChartDataSet(values: yVals, label: "DataSet 1") + + set1.lineWidth = 1.75 + set1.circleRadius = 5.0 + set1.circleHoleRadius = 2.5 + set1.setColor(.white) + set1.setCircleColor(.white) + set1.highlightColor = .white + set1.drawValuesEnabled = false + + return LineChartData(dataSet: set1) + } +} diff --git a/ChartsDemo/Swift/Demos/CombinedChartViewController.swift b/ChartsDemo/Swift/Demos/CombinedChartViewController.swift new file mode 100644 index 0000000000..d3162293a7 --- /dev/null +++ b/ChartsDemo/Swift/Demos/CombinedChartViewController.swift @@ -0,0 +1,233 @@ +// +// CombinedChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +private let ITEM_COUNT = 12 + +class CombinedChartViewController: DemoBaseViewController { + @IBOutlet var chartView: CombinedChartView! + + let months = ["Jan", "Feb", "Mar", + "Apr", "May", "Jun", + "Jul", "Aug", "Sep", + "Oct", "Nov", "Dec"] + + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Combined Chart" + self.options = [.toggleLineValues, + .toggleBarValues, + .saveToGallery, + .toggleData, + .toggleBarBorders, + .removeDataSet] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.drawBarShadowEnabled = false + chartView.highlightFullBarEnabled = false + + + chartView.drawOrder = [DrawOrder.bar.rawValue, + DrawOrder.bubble.rawValue, + DrawOrder.candle.rawValue, + DrawOrder.line.rawValue, + DrawOrder.scatter.rawValue] + + let l = chartView.legend + l.wordWrapEnabled = true + l.horizontalAlignment = .center + l.verticalAlignment = .bottom + l.orientation = .horizontal + l.drawInside = false +// chartView.legend = l + + let rightAxis = chartView.rightAxis + rightAxis.axisMinimum = 0 + + let leftAxis = chartView.leftAxis + leftAxis.axisMinimum = 0 + + let xAxis = chartView.xAxis + xAxis.labelPosition = .bothSided + xAxis.axisMinimum = 0 + xAxis.granularity = 1 + xAxis.valueFormatter = self + + self.updateChartData() + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setChartData() + } + + func setChartData() { + let data = CombinedChartData() + data.lineData = generateLineData() + data.barData = generateBarData() + data.bubbleData = generateBubbleData() + data.scatterData = generateScatterData() + data.candleData = generateCandleData() + + chartView.xAxis.axisMaximum = data.xMax + 0.25 + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleLineValues: + for set in chartView.data!.dataSets { + if let set = set as? LineChartDataSet { + set.drawValuesEnabled = !set .drawValuesEnabled + + } + } + chartView.setNeedsDisplay() + + case .toggleBarValues: + for set in chartView.data!.dataSets { + if let set = set as? BarChartDataSet { + set.drawValuesEnabled = !set .drawValuesEnabled + } + } + chartView.setNeedsDisplay() + + case .removeDataSet: + let rnd = Int(arc4random_uniform(UInt32(chartView.data!.dataSetCount))) + chartView.data?.removeDataSet(chartView.data!.getDataSetByIndex(rnd)) + chartView.data?.notifyDataChanged() + chartView.notifyDataSetChanged() + + default: + super.handleOption(option, forChartView: chartView) + } + } + + func generateLineData() -> LineChartData { + let entries = (0.. ChartDataEntry in + return ChartDataEntry(x: Double(i) + 0.5, y: Double(arc4random_uniform(15) + 5)) + } + + let set = LineChartDataSet(values: entries, label: "Line DataSet") + set.setColor(UIColor(red: 240/255, green: 238/255, blue: 70/255, alpha: 1)) + set.lineWidth = 2.5 + set.setCircleColor(UIColor(red: 240/255, green: 238/255, blue: 70/255, alpha: 1)) + set.circleRadius = 5 + set.circleHoleRadius = 2.5 + set.fillColor = UIColor(red: 240/255, green: 238/255, blue: 70/255, alpha: 1) + set.mode = .cubicBezier + set.drawValuesEnabled = true + set.valueFont = .systemFont(ofSize: 10) + set.valueTextColor = UIColor(red: 240/255, green: 238/255, blue: 70/255, alpha: 1) + + set.axisDependency = .left + + return LineChartData(dataSet: set) + } + + func generateBarData() -> BarChartData { + let entries1 = (0.. BarChartDataEntry in + return BarChartDataEntry(x: 0, y: Double(arc4random_uniform(25) + 25)) + } + let entries2 = (0.. BarChartDataEntry in + return BarChartDataEntry(x: 0, yValues: [Double(arc4random_uniform(13) + 12), Double(arc4random_uniform(13) + 12)]) + } + + let set1 = BarChartDataSet(values: entries1, label: "Bar 1") + set1.setColor(UIColor(red: 60/255, green: 220/255, blue: 78/255, alpha: 1)) + set1.valueTextColor = UIColor(red: 60/255, green: 220/255, blue: 78/255, alpha: 1) + set1.valueFont = .systemFont(ofSize: 10) + set1.axisDependency = .left + + let set2 = BarChartDataSet(values: entries2, label: "") + set2.stackLabels = ["Stack 1", "Stack 2"] + set2.colors = [UIColor(red: 61/255, green: 165/255, blue: 255/255, alpha: 1), + UIColor(red: 23/255, green: 197/255, blue: 255/255, alpha: 1) + ] + set2.valueTextColor = UIColor(red: 61/255, green: 165/255, blue: 255/255, alpha: 1) + set2.valueFont = .systemFont(ofSize: 10) + set2.axisDependency = .left + + let groupSpace = 0.06 + let barSpace = 0.02 // x2 dataset + let barWidth = 0.45 // x2 dataset + // (0.45 + 0.02) * 2 + 0.06 = 1.00 -> interval per "group" + + let data = BarChartData(dataSets: [set1, set2]) + data.barWidth = barWidth + + // make this BarData object grouped + data.groupBars(fromX: 0, groupSpace: groupSpace, barSpace: barSpace) + + return data + } + + func generateScatterData() -> ScatterChartData { + let entries = stride(from: 0.0, to: Double(ITEM_COUNT), by: 0.5).map { (i) -> ChartDataEntry in + return ChartDataEntry(x: i+0.25, y: Double(arc4random_uniform(10) + 55)) + } + + let set = ScatterChartDataSet(values: entries, label: "Scatter DataSet") + set.colors = ChartColorTemplates.material() + set.scatterShapeSize = 4.5 + set.drawValuesEnabled = false + set.valueFont = .systemFont(ofSize: 10) + + return ScatterChartData(dataSet: set) + } + + func generateCandleData() -> CandleChartData { + let entries = stride(from: 0, to: ITEM_COUNT, by: 2).map { (i) -> CandleChartDataEntry in + return CandleChartDataEntry(x: Double(i+1), shadowH: 90, shadowL: 70, open: 85, close: 75) + } + + let set = CandleChartDataSet(values: entries, label: "Candle DataSet") + set.setColor(UIColor(red: 80/255, green: 80/255, blue: 80/255, alpha: 1)) + set.decreasingColor = UIColor(red: 142/255, green: 150/255, blue: 175/255, alpha: 1) + set.shadowColor = .darkGray + set.valueFont = .systemFont(ofSize: 10) + set.drawValuesEnabled = false + + return CandleChartData(dataSet: set) + } + + func generateBubbleData() -> BubbleChartData { + let entries = (0.. BubbleChartDataEntry in + return BubbleChartDataEntry(x: Double(i) + 0.5, + y: Double(arc4random_uniform(10) + 105), + size: CGFloat(arc4random_uniform(50) + 105)) + } + + let set = BubbleChartDataSet(values: entries, label: "Bubble DataSet") + set.setColors(ChartColorTemplates.vordiplom(), alpha: 1) + set.valueTextColor = .white + set.valueFont = .systemFont(ofSize: 10) + set.drawValuesEnabled = true + + return BubbleChartData(dataSet: set) + } +} + +extension CombinedChartViewController: IAxisValueFormatter { + func stringForValue(_ value: Double, axis: AxisBase?) -> String { + return months[Int(value) % months.count] + } +} diff --git a/ChartsDemo/Swift/Demos/CubicLineChartViewController.swift b/ChartsDemo/Swift/Demos/CubicLineChartViewController.swift new file mode 100644 index 0000000000..627d13d08d --- /dev/null +++ b/ChartsDemo/Swift/Demos/CubicLineChartViewController.swift @@ -0,0 +1,155 @@ +// +// CubicLineChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +private class CubicLineSampleFillFormatter: IFillFormatter { + func getFillLinePosition(dataSet: ILineChartDataSet, dataProvider: LineChartDataProvider) -> CGFloat { + return -10 + } +} + +class CubicLineChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: LineChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Cubic Line Chart" + + self.options = [.toggleValues, + .toggleFilled, + .toggleCircles, + .toggleCubic, + .toggleHorizontalCubic, + .toggleStepped, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.setViewPortOffsets(left: 0, top: 20, right: 0, bottom: 0) + chartView.backgroundColor = UIColor(red: 104/255, green: 241/255, blue: 175/255, alpha: 1) + + chartView.dragEnabled = true + chartView.setScaleEnabled(true) + chartView.pinchZoomEnabled = false + chartView.maxHighlightDistance = 300 + + chartView.xAxis.enabled = false + + let yAxis = chartView.leftAxis + yAxis.labelFont = UIFont(name: "HelveticaNeue-Light", size:12)! + yAxis.setLabelCount(6, force: false) + yAxis.labelTextColor = .white + yAxis.labelPosition = .insideChart + yAxis.axisLineColor = .white + + chartView.rightAxis.enabled = false + chartView.legend.enabled = false + + sliderX.value = 45 + sliderY.value = 100 + self.slidersValueChanged(nil) + + chartView.animate(xAxisDuration: 2, yAxisDuration: 2) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value + 1), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let yVals1 = (0.. ChartDataEntry in + let mult = range + 1 + let val = Double(arc4random_uniform(mult) + 20) + return ChartDataEntry(x: Double(i), y: val) + } + + let set1 = LineChartDataSet(values: yVals1, label: "DataSet 1") + set1.mode = .cubicBezier + set1.drawCirclesEnabled = false + set1.lineWidth = 1.8 + set1.circleRadius = 4 + set1.setCircleColor(.white) + set1.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) + set1.fillColor = .white + set1.fillAlpha = 1 + set1.drawHorizontalHighlightIndicatorEnabled = false + set1.fillFormatter = CubicLineSampleFillFormatter() + + let data = LineChartData(dataSet: set1) + data.setValueFont(UIFont(name: "HelveticaNeue-Light", size: 9)!) + data.setDrawValues(false) + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleFilled: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawFilledEnabled = !set.drawFilledEnabled + } + chartView.setNeedsDisplay() + + case .toggleCircles: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawCirclesEnabled = !set.drawCirclesEnabled + } + chartView.setNeedsDisplay() + + case .toggleCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier + } + chartView.setNeedsDisplay() + + case .toggleStepped: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .stepped) ? .linear : .stepped + } + chartView.setNeedsDisplay() + + case .toggleHorizontalCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier + } + chartView.setNeedsDisplay() + + default: + super.handleOption(option, forChartView: chartView) + } + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/HalfPieChartViewController.swift b/ChartsDemo/Swift/Demos/HalfPieChartViewController.swift new file mode 100644 index 0000000000..7c4ed80ba7 --- /dev/null +++ b/ChartsDemo/Swift/Demos/HalfPieChartViewController.swift @@ -0,0 +1,142 @@ +// +// HalfPieChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class HalfPieChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: PieChartView! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Half Pie Bar Chart" + + self.options = [.toggleValues, + .toggleXValues, + .togglePercent, + .toggleHole, + .animateX, + .animateY, + .animateXY, + .spin, + .drawCenter, + .saveToGallery, + .toggleData] + + self.setup(pieChartView: chartView) + + chartView.delegate = self + + chartView.holeColor = .white + chartView.transparentCircleColor = NSUIColor.white.withAlphaComponent(0.43) + chartView.holeRadiusPercent = 0.58 + chartView.rotationEnabled = false + chartView.highlightPerTapEnabled = true + + chartView.maxAngle = 180 // Half chart + chartView.rotationAngle = 180 // Rotate to make the half on the upper side + chartView.centerTextOffset = CGPoint(x: 0, y: -20) + + let l = chartView.legend + l.horizontalAlignment = .center + l.verticalAlignment = .top + l.orientation = .horizontal + l.drawInside = false + l.xEntrySpace = 7 + l.yEntrySpace = 0 + l.yOffset = 0 +// chartView.legend = l + + // entry label styling + chartView.entryLabelColor = .white + chartView.entryLabelFont = UIFont(name:"HelveticaNeue-Light", size:12)! + + self.updateChartData() + + chartView.animate(xAxisDuration: 1.4, easingOption: .easeOutBack) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(4, range: 100) + } + + func setDataCount(_ count: Int, range: UInt32) { + let entries = (0.. PieChartDataEntry in + // IMPORTANT: In a PieChart, no values (Entry) should have the same xIndex (even if from different DataSets), since no values can be drawn above each other. + return PieChartDataEntry(value: Double(arc4random_uniform(range) + range / 5), + label: parties[i % parties.count]) + } + + let set = PieChartDataSet(values: entries, label: "Election Results") + set.sliceSpace = 3 + set.selectionShift = 5 + set.colors = ChartColorTemplates.material() + + let data = PieChartData(dataSet: set) + + let pFormatter = NumberFormatter() + pFormatter.numberStyle = .percent + pFormatter.maximumFractionDigits = 1 + pFormatter.multiplier = 1 + pFormatter.percentSymbol = " %" + data.setValueFormatter(DefaultValueFormatter(formatter: pFormatter)) + + data.setValueFont(UIFont(name: "HelveticaNeue-Light", size: 11)!) + data.setValueTextColor(.white) + + chartView.data = data + + chartView.setNeedsDisplay() + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleXValues: + chartView.drawEntryLabelsEnabled = !chartView.drawEntryLabelsEnabled + chartView.setNeedsDisplay() + + case .togglePercent: + chartView.usePercentValuesEnabled = !chartView.usePercentValuesEnabled + chartView.setNeedsDisplay() + + case .toggleHole: + chartView.drawHoleEnabled = !chartView.drawHoleEnabled + chartView.setNeedsDisplay() + + case .drawCenter: + chartView.drawCenterTextEnabled = !chartView.drawCenterTextEnabled + chartView.setNeedsDisplay() + + case .animateX: + chartView.animate(xAxisDuration: 1.4) + + case .animateY: + chartView.animate(yAxisDuration: 1.4) + + case .animateXY: + chartView.animate(xAxisDuration: 1.4, yAxisDuration: 1.4) + + case .spin: + chartView.spin(duration: 2, + fromAngle: chartView.rotationAngle, + toAngle: chartView.rotationAngle + 360, + easingOption: .easeInCubic) + + default: + handleOption(option, forChartView: chartView) + } + } +} diff --git a/ChartsDemo/Swift/Demos/HorizontalBarChartViewController.swift b/ChartsDemo/Swift/Demos/HorizontalBarChartViewController.swift new file mode 100644 index 0000000000..2dbcab9491 --- /dev/null +++ b/ChartsDemo/Swift/Demos/HorizontalBarChartViewController.swift @@ -0,0 +1,124 @@ +// +// HorizontalBarChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class HorizontalBarChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: HorizontalBarChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Horizontal Bar Char" + self.options = [.toggleValues, + .toggleIcons, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData, + .toggleBarBorders] + + self.setup(barLineChartView: chartView) + + chartView.delegate = self + + chartView.drawBarShadowEnabled = false + chartView.drawValueAboveBarEnabled = true + + chartView.maxVisibleCount = 60 + + let xAxis = chartView.xAxis + xAxis.labelPosition = .bottom + xAxis.labelFont = .systemFont(ofSize: 10) + xAxis.drawAxisLineEnabled = true + xAxis.granularity = 10 + + let leftAxis = chartView.leftAxis + leftAxis.labelFont = .systemFont(ofSize: 10) + leftAxis.drawAxisLineEnabled = true + leftAxis.drawGridLinesEnabled = true + leftAxis.axisMinimum = 0 + + let rightAxis = chartView.rightAxis + rightAxis.enabled = true + rightAxis.labelFont = .systemFont(ofSize: 10) + rightAxis.drawAxisLineEnabled = true + rightAxis.axisMinimum = 0 + + let l = chartView.legend + l.horizontalAlignment = .left + l.verticalAlignment = .bottom + l.orientation = .horizontal + l.drawInside = false + l.form = .square + l.formSize = 8 + l.font = UIFont(name: "HelveticaNeue-Light", size: 11)! + l.xEntrySpace = 4 +// chartView.legend = l + + chartView.fitBars = true + + sliderX.value = 12 + sliderY.value = 50 + slidersValueChanged(nil) + + chartView.animate(yAxisDuration: 2.5) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value) + 1, range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let barWidth = 9.0 + let spaceForBar = 10.0 + + let yVals = (0.. BarChartDataEntry in + let mult = range + 1 + let val = Double(arc4random_uniform(mult)) + return BarChartDataEntry(x: Double(i)*spaceForBar, y: val, icon: #imageLiteral(resourceName: "icon")) + } + + let set1 = BarChartDataSet(values: yVals, label: "DataSet") + set1.drawIconsEnabled = false + + let data = BarChartData(dataSet: set1) + data.setValueFont(UIFont(name:"HelveticaNeue-Light", size:10)!) + data.barWidth = barWidth + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/LineChart1ViewController.swift b/ChartsDemo/Swift/Demos/LineChart1ViewController.swift new file mode 100644 index 0000000000..bf5eb7f67d --- /dev/null +++ b/ChartsDemo/Swift/Demos/LineChart1ViewController.swift @@ -0,0 +1,187 @@ +// +// LineChart1ViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class LineChart1ViewController: DemoBaseViewController { + + @IBOutlet var chartView: LineChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Line Chart 1" + self.options = [.toggleValues, + .toggleFilled, + .toggleCircles, + .toggleCubic, + .toggleHorizontalCubic, + .toggleIcons, + .toggleStepped, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + chartView.dragEnabled = true + chartView.setScaleEnabled(true) + chartView.pinchZoomEnabled = true + + // x-axis limit line + let llXAxis = ChartLimitLine(limit: 10, label: "Index 10") + llXAxis.lineWidth = 4 + llXAxis.lineDashLengths = [10, 10, 0] + llXAxis.labelPosition = .rightBottom + llXAxis.valueFont = .systemFont(ofSize: 10) + + chartView.xAxis.gridLineDashLengths = [10, 10] + chartView.xAxis.gridLineDashPhase = 0 + + let ll1 = ChartLimitLine(limit: 150, label: "Upper Limit") + ll1.lineWidth = 4 + ll1.lineDashLengths = [5, 5] + ll1.labelPosition = .rightTop + ll1.valueFont = .systemFont(ofSize: 10) + + let ll2 = ChartLimitLine(limit: -30, label: "Lower Limit") + ll2.lineWidth = 4 + ll2.lineDashLengths = [5,5] + ll2.labelPosition = .rightBottom + ll2.valueFont = .systemFont(ofSize: 10) + + let leftAxis = chartView.leftAxis + leftAxis.removeAllLimitLines() + leftAxis.addLimitLine(ll1) + leftAxis.addLimitLine(ll2) + leftAxis.axisMaximum = 200 + leftAxis.axisMinimum = -50 + leftAxis.gridLineDashLengths = [5, 5] + leftAxis.drawLimitLinesBehindDataEnabled = true + + chartView.rightAxis.enabled = false + + //[_chartView.viewPortHandler setMaximumScaleY: 2.f]; + //[_chartView.viewPortHandler setMaximumScaleX: 2.f]; + + let marker = BalloonMarker(color: UIColor(white: 180/255, alpha: 1), + font: .systemFont(ofSize: 12), + textColor: .white, + insets: UIEdgeInsets(top: 8, left: 8, bottom: 20, right: 8)) + marker.chartView = chartView + marker.minimumSize = CGSize(width: 80, height: 40) + chartView.marker = marker + + chartView.legend.form = .line + + sliderX.value = 45 + sliderY.value = 100 + slidersValueChanged(nil) + + chartView.animate(xAxisDuration: 2.5) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let values = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 3) + return ChartDataEntry(x: Double(i), y: val, icon: #imageLiteral(resourceName: "icon")) + } + + let set1 = LineChartDataSet(values: values, label: "DataSet 1") + set1.drawIconsEnabled = false + + set1.lineDashLengths = [5, 2.5] + set1.highlightLineDashLengths = [5, 2.5] + set1.setColor(.black) + set1.setCircleColor(.black) + set1.lineWidth = 1 + set1.circleRadius = 3 + set1.drawCircleHoleEnabled = false + set1.valueFont = .systemFont(ofSize: 9) + set1.formLineDashLengths = [5, 2.5] + set1.formLineWidth = 1 + set1.formLineWidth = 15 + + let gradientColors = [ChartColorTemplates.colorFromString("#00ff0000").cgColor, + ChartColorTemplates.colorFromString("#ffff0000").cgColor] + let gradient = CGGradient(colorsSpace: nil, colors: gradientColors as CFArray, locations: nil)! + + set1.fillAlpha = 1 + set1.fill = Fill(linearGradient: gradient, angle: 90) //.linearGradient(gradient, angle: 90) + set1.drawFilledEnabled = true + + let data = LineChartData(dataSet: set1) + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleFilled: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawFilledEnabled = !set.drawFilledEnabled + } + chartView.setNeedsDisplay() + + case .toggleCircles: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawCirclesEnabled = !set.drawCirclesEnabled + } + chartView.setNeedsDisplay() + + case .toggleCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier + } + chartView.setNeedsDisplay() + + case .toggleStepped: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .stepped) ? .linear : .stepped + } + chartView.setNeedsDisplay() + + case .toggleHorizontalCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier + } + chartView.setNeedsDisplay() + + default: + super.handleOption(option, forChartView: chartView) + } + } + + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/LineChart2ViewController.swift b/ChartsDemo/Swift/Demos/LineChart2ViewController.swift new file mode 100644 index 0000000000..564d50f66d --- /dev/null +++ b/ChartsDemo/Swift/Demos/LineChart2ViewController.swift @@ -0,0 +1,200 @@ +// +// LineChart2ViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class LineChart2ViewController: DemoBaseViewController { + + @IBOutlet var chartView: LineChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Line Chart 2" + self.options = [.toggleValues, + .toggleFilled, + .toggleCircles, + .toggleCubic, + .toggleHorizontalCubic, + .toggleStepped, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + chartView.dragEnabled = true + chartView.setScaleEnabled(true) + chartView.pinchZoomEnabled = true + + let l = chartView.legend + l.form = .line + l.font = UIFont(name: "HelveticaNeue-Light", size: 11)! + l.textColor = .white + l.horizontalAlignment = .left + l.verticalAlignment = .bottom + l.orientation = .horizontal + l.drawInside = false + + let xAxis = chartView.xAxis + xAxis.labelFont = .systemFont(ofSize: 11) + xAxis.labelTextColor = .white + xAxis.drawAxisLineEnabled = false + + let leftAxis = chartView.leftAxis + leftAxis.labelTextColor = UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1) + leftAxis.axisMaximum = 200 + leftAxis.axisMinimum = 0 + leftAxis.drawGridLinesEnabled = true + leftAxis.granularityEnabled = true + + let rightAxis = chartView.rightAxis + rightAxis.labelTextColor = .red + rightAxis.axisMaximum = 900 + rightAxis.axisMinimum = -200 + rightAxis.granularityEnabled = false + + sliderX.value = 20 + sliderY.value = 30 + slidersValueChanged(nil) + + chartView.animate(xAxisDuration: 2.5) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value + 1), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let yVals1 = (0.. ChartDataEntry in + let mult = range / 2 + let val = Double(arc4random_uniform(mult) + 50) + return ChartDataEntry(x: Double(i), y: val) + } + let yVals2 = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 450) + return ChartDataEntry(x: Double(i), y: val) + } + let yVals3 = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 500) + return ChartDataEntry(x: Double(i), y: val) + } + + let set1 = LineChartDataSet(values: yVals1, label: "DataSet 1") + set1.axisDependency = .left + set1.setColor(UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)) + set1.setCircleColor(.white) + set1.lineWidth = 2 + set1.circleRadius = 3 + set1.fillAlpha = 65/255 + set1.fillColor = UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1) + set1.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) + set1.drawCircleHoleEnabled = false + + let set2 = LineChartDataSet(values: yVals2, label: "DataSet 2") + set2.axisDependency = .right + set2.setColor(.red) + set2.setCircleColor(.white) + set2.lineWidth = 2 + set2.circleRadius = 3 + set2.fillAlpha = 65/255 + set2.fillColor = .red + set2.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) + set2.drawCircleHoleEnabled = false + + let set3 = LineChartDataSet(values: yVals3, label: "DataSet 3") + set3.axisDependency = .right + set3.setColor(.yellow) + set3.setCircleColor(.white) + set3.lineWidth = 2 + set3.circleRadius = 3 + set3.fillAlpha = 65/255 + set3.fillColor = UIColor.yellow.withAlphaComponent(200/255) + set3.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) + set3.drawCircleHoleEnabled = false + + let data = LineChartData(dataSets: [set1, set2, set3]) + data.setValueTextColor(.white) + data.setValueFont(.systemFont(ofSize: 9)) + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleFilled: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawFilledEnabled = !set.drawFilledEnabled + } + chartView.setNeedsDisplay() + + case .toggleCircles: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawCirclesEnabled = !set.drawCirclesEnabled + } + chartView.setNeedsDisplay() + + case .toggleCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier + } + chartView.setNeedsDisplay() + + case .toggleStepped: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .stepped) ? .linear : .stepped + } + chartView.setNeedsDisplay() + + case .toggleHorizontalCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier + } + chartView.setNeedsDisplay() + + default: + super.handleOption(option, forChartView: chartView) + } + } + + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +//} + // TODO: Declarations in extensions cannot override yet. +//extension LineChart2ViewController { + override func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) { + super.chartValueSelected(chartView, entry: entry, highlight: highlight) + + self.chartView.centerViewToAnimated(xValue: entry.x, yValue: entry.y, + axis: self.chartView.data!.getDataSetByIndex(highlight.dataSetIndex).axisDependency, + duration: 1) + //[_chartView moveViewToAnimatedWithXValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0]; + //[_chartView zoomAndCenterViewAnimatedWithScaleX:1.8 scaleY:1.8 xValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0]; + } +} diff --git a/ChartsDemo/Swift/Demos/LineChartFilledViewController.swift b/ChartsDemo/Swift/Demos/LineChartFilledViewController.swift new file mode 100644 index 0000000000..11726e4e4f --- /dev/null +++ b/ChartsDemo/Swift/Demos/LineChartFilledViewController.swift @@ -0,0 +1,117 @@ +// +// LineChartFilledViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class LineChartFilledViewController: DemoBaseViewController { + + @IBOutlet var chartView: LineChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Filled Line Chart" + + chartView.delegate = self + + chartView.backgroundColor = .white + chartView.gridBackgroundColor = UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 150/255) + chartView.drawGridBackgroundEnabled = true + + chartView.drawBordersEnabled = true + + chartView.chartDescription?.enabled = false + + chartView.pinchZoomEnabled = false + chartView.dragEnabled = true + chartView.setScaleEnabled(true) + + chartView.legend.enabled = false + + chartView.xAxis.enabled = false + + let leftAxis = chartView.leftAxis + leftAxis.axisMaximum = 900 + leftAxis.axisMinimum = -250 + leftAxis.drawAxisLineEnabled = false + + chartView.rightAxis.enabled = false + + sliderX.value = 100 + sliderY.value = 60 + slidersValueChanged(nil) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let yVals1 = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 50) + return ChartDataEntry(x: Double(i), y: val) + } + let yVals2 = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 450) + return ChartDataEntry(x: Double(i), y: val) + } + + let set1 = LineChartDataSet(values: yVals1, label: "DataSet 1") + set1.axisDependency = .left + set1.setColor(UIColor(red: 255/255, green: 241/255, blue: 46/255, alpha: 1)) + set1.drawCirclesEnabled = false + set1.lineWidth = 2 + set1.circleRadius = 3 + set1.fillAlpha = 1 + set1.drawFilledEnabled = true + set1.fillColor = .white + set1.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) + set1.drawCircleHoleEnabled = false + set1.fillFormatter = DefaultFillFormatter { _,_ -> CGFloat in + return CGFloat(self.chartView.leftAxis.axisMinimum) + } + + let set2 = LineChartDataSet(values: yVals2, label: "DataSet 2") + set2.axisDependency = .left + set2.setColor(UIColor(red: 255/255, green: 241/255, blue: 46/255, alpha: 1)) + set2.drawCirclesEnabled = false + set2.lineWidth = 2 + set2.circleRadius = 3 + set2.fillAlpha = 1 + set2.drawFilledEnabled = true + set2.fillColor = .white + set2.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) + set2.drawCircleHoleEnabled = false + set2.fillFormatter = DefaultFillFormatter { _,_ -> CGFloat in + return CGFloat(self.chartView.leftAxis.axisMaximum) + } + + let data = LineChartData(dataSets: [set1, set2]) + data.setDrawValues(false) + + chartView.data = data + } + + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/LineChartTimeViewController.swift b/ChartsDemo/Swift/Demos/LineChartTimeViewController.swift new file mode 100644 index 0000000000..1b4c425ba6 --- /dev/null +++ b/ChartsDemo/Swift/Demos/LineChartTimeViewController.swift @@ -0,0 +1,161 @@ +// +// LineChartTimeViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class LineChartTimeViewController: DemoBaseViewController { + @IBOutlet var chartView: LineChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderTextX: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Line Chart 2" + self.options = [.toggleValues, + .toggleFilled, + .toggleCircles, + .toggleCubic, + .toggleHorizontalCubic, + .toggleStepped, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.dragEnabled = true + chartView.setScaleEnabled(true) + chartView.pinchZoomEnabled = false + chartView.highlightPerDragEnabled = true + + chartView.backgroundColor = .white + + chartView.legend.enabled = false + + let xAxis = chartView.xAxis + xAxis.labelPosition = .topInside + xAxis.labelFont = .systemFont(ofSize: 10, weight: .light) + xAxis.labelTextColor = UIColor(red: 255/255, green: 192/255, blue: 56/255, alpha: 1) + xAxis.drawAxisLineEnabled = false + xAxis.drawGridLinesEnabled = true + xAxis.centerAxisLabelsEnabled = true + xAxis.granularity = 3600 + xAxis.valueFormatter = DateValueFormatter() + + let leftAxis = chartView.leftAxis + leftAxis.labelPosition = .insideChart + leftAxis.labelFont = .systemFont(ofSize: 12, weight: .light) + leftAxis.drawGridLinesEnabled = true + leftAxis.granularityEnabled = true + leftAxis.axisMinimum = 0 + leftAxis.axisMaximum = 170 + leftAxis.yOffset = -9 + leftAxis.labelTextColor = UIColor(red: 255/255, green: 192/255, blue: 56/255, alpha: 1) + + + chartView.rightAxis.enabled = false + + chartView.legend.form = .line + + sliderX.value = 100 + slidersValueChanged(nil) + + chartView.animate(xAxisDuration: 2.5) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: 30) + } + + func setDataCount(_ count: Int, range: UInt32) { + let now = Date().timeIntervalSince1970 + let hourSeconds: TimeInterval = 3600 + + let from = now - (Double(count) / 2) * hourSeconds + let to = now + (Double(count) / 2) * hourSeconds + + let values = stride(from: from, to: to, by: hourSeconds).map { (x) -> ChartDataEntry in + let y = arc4random_uniform(range) + 50 + return ChartDataEntry(x: x, y: Double(y)) + } + + let set1 = LineChartDataSet(values: values, label: "DataSet 1") + set1.axisDependency = .left + set1.setColor(UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)) + set1.lineWidth = 1.5 + set1.drawCirclesEnabled = false + set1.drawValuesEnabled = false + set1.fillAlpha = 0.26 + set1.fillColor = UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1) + set1.highlightColor = UIColor(red: 244/255, green: 117/255, blue: 117/255, alpha: 1) + set1.drawCircleHoleEnabled = false + + let data = LineChartData(dataSet: set1) + data.setValueTextColor(.white) + data.setValueFont(.systemFont(ofSize: 9, weight: .light)) + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleFilled: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawFilledEnabled = !set.drawFilledEnabled + } + chartView.setNeedsDisplay() + + case .toggleCircles: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.drawCirclesEnabled = !set.drawCirclesEnabled + } + chartView.setNeedsDisplay() + + case .toggleCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .linear : .cubicBezier + } + chartView.setNeedsDisplay() + + case .toggleStepped: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .stepped) ? .linear : .stepped + } + chartView.setNeedsDisplay() + + case .toggleHorizontalCubic: + for set in chartView.data!.dataSets as! [LineChartDataSet] { + set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier + } + chartView.setNeedsDisplay() + + default: + super.handleOption(option, forChartView: chartView) + } + } + + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/MultipleBarChartViewController.swift b/ChartsDemo/Swift/Demos/MultipleBarChartViewController.swift new file mode 100644 index 0000000000..93c9f4654b --- /dev/null +++ b/ChartsDemo/Swift/Demos/MultipleBarChartViewController.swift @@ -0,0 +1,154 @@ +// +// MultipleBarChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class MultipleBarChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: BarChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Multiple Bar Chart" + + self.options = [.toggleValues, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData, + .toggleBarBorders] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.pinchZoomEnabled = false + chartView.drawBarShadowEnabled = false + + let marker = BalloonMarker(color: UIColor(white: 180/255, alpha: 1), font: .systemFont(ofSize: 12), textColor: .white, insets: UIEdgeInsets(top: 8, left: 8, bottom: 20, right: 8)) + marker.chartView = chartView + marker.minimumSize = CGSize(width: 80, height: 40) + chartView.marker = marker + + let l = chartView.legend + l.horizontalAlignment = .right + l.verticalAlignment = .top + l.orientation = .vertical + l.drawInside = true + l.font = .systemFont(ofSize: 8, weight: .light) + l.yOffset = 10 + l.xOffset = 10 + l.yEntrySpace = 0 +// chartView.legend = l + + let xAxis = chartView.xAxis + xAxis.labelFont = .systemFont(ofSize: 10, weight: .light) + xAxis.granularity = 1 + xAxis.centerAxisLabelsEnabled = true + xAxis.valueFormatter = IntAxisValueFormatter() + + let leftAxisFormatter = NumberFormatter() + leftAxisFormatter.maximumFractionDigits = 1 + + let leftAxis = chartView.leftAxis + leftAxis.labelFont = .systemFont(ofSize: 10, weight: .light) + leftAxis.valueFormatter = LargeValueFormatter() + leftAxis.spaceTop = 0.35 + leftAxis.axisMinimum = 0 + + chartView.rightAxis.enabled = false + + sliderX.value = 10 + sliderY.value = 100 + slidersValueChanged(nil) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let groupSpace = 0.08 + let barSpace = 0.03 + let barWidth = 0.2 + // (0.2 + 0.03) * 4 + 0.08 = 1.00 -> interval per "group" + + let randomMultiplier = range * 100000 + let groupCount = count + 1 + let startYear = 1980 + let endYear = startYear + groupCount + + let block: (Int) -> BarChartDataEntry = { (i) -> BarChartDataEntry in + return BarChartDataEntry(x: Double(i), y: Double(arc4random_uniform(randomMultiplier))) + } + let yVals1 = (startYear ..< endYear).map(block) + let yVals2 = (startYear ..< endYear).map(block) + let yVals3 = (startYear ..< endYear).map(block) + let yVals4 = (startYear ..< endYear).map(block) + + let set1 = BarChartDataSet(values: yVals1, label: "Company A") + set1.setColor(UIColor(red: 104/255, green: 241/255, blue: 175/255, alpha: 1)) + + let set2 = BarChartDataSet(values: yVals2, label: "Company B") + set2.setColor(UIColor(red: 164/255, green: 228/255, blue: 251/255, alpha: 1)) + + let set3 = BarChartDataSet(values: yVals3, label: "Company C") + set3.setColor(UIColor(red: 242/255, green: 247/255, blue: 158/255, alpha: 1)) + + let set4 = BarChartDataSet(values: yVals4, label: "Company D") + set4.setColor(UIColor(red: 255/255, green: 102/255, blue: 0/255, alpha: 1)) + + let data = BarChartData(dataSets: [set1, set2, set3, set4]) + data.setValueFont(.systemFont(ofSize: 10, weight: .light)) + data.setValueFormatter(LargeValueFormatter()) + + // specify the width each bar should have + data.barWidth = barWidth + + // restrict the x-axis range + chartView.xAxis.axisMinimum = Double(startYear) + + // groupWidthWithGroupSpace(...) is a helper that calculates the width each group needs based on the provided parameters + chartView.xAxis.axisMaximum = Double(startYear) + data.groupWidth(groupSpace: groupSpace, barSpace: barSpace) * Double(groupCount) + + data.groupBars(fromX: Double(startYear), groupSpace: groupSpace, barSpace: barSpace) + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + let startYear = 1980 + let endYear = startYear + Int(sliderX.value) + + sliderTextX.text = "\(startYear)-\(endYear)" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/MultipleLinesChartViewController.swift b/ChartsDemo/Swift/Demos/MultipleLinesChartViewController.swift new file mode 100644 index 0000000000..4b11f73d28 --- /dev/null +++ b/ChartsDemo/Swift/Demos/MultipleLinesChartViewController.swift @@ -0,0 +1,138 @@ +// +// MultipleLinesChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class MultipleLinesChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: LineChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Multiple Lines Chart" + self.options = [.toggleValues, + .toggleFilled, + .toggleCircles, + .toggleCubic, + .toggleStepped, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.leftAxis.enabled = false + chartView.rightAxis.drawAxisLineEnabled = false + chartView.xAxis.drawAxisLineEnabled = false + + chartView.drawBordersEnabled = false + chartView.setScaleEnabled(true) + + let l = chartView.legend + l.horizontalAlignment = .right + l.verticalAlignment = .top + l.orientation = .vertical + l.drawInside = false +// chartView.legend = l + + sliderX.value = 20 + sliderY.value = 100 + slidersValueChanged(nil) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + // TODO: Refine data creation + func setDataCount(_ count: Int, range: UInt32) { + let colors = ChartColorTemplates.vordiplom()[0...2] + + let block: (Int) -> ChartDataEntry = { (i) -> ChartDataEntry in + let val = Double(arc4random_uniform(range) + 3) + return ChartDataEntry(x: Double(i), y: val) + } + let dataSets = (0..<3).map { i -> LineChartDataSet in + let yVals = (0.. String { + return String(format: "%03.0f-%03.0f", value, value + 10) + } +} diff --git a/ChartsDemo/Swift/Demos/PieChartViewController.swift b/ChartsDemo/Swift/Demos/PieChartViewController.swift new file mode 100644 index 0000000000..5b0acf4b64 --- /dev/null +++ b/ChartsDemo/Swift/Demos/PieChartViewController.swift @@ -0,0 +1,153 @@ +// +// PieChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class PieChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: PieChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Half Pie Bar Chart" + + self.options = [.toggleValues, + .toggleXValues, + .togglePercent, + .toggleHole, + .toggleIcons, + .animateX, + .animateY, + .animateXY, + .spin, + .drawCenter, + .saveToGallery, + .toggleData] + + self.setup(pieChartView: chartView) + + chartView.delegate = self + + let l = chartView.legend + l.horizontalAlignment = .right + l.verticalAlignment = .top + l.orientation = .vertical + l.xEntrySpace = 7 + l.yEntrySpace = 0 + l.yOffset = 0 +// chartView.legend = l + + // entry label styling + chartView.entryLabelColor = .white + chartView.entryLabelFont = .systemFont(ofSize: 12, weight: .light) + + sliderX.value = 4 + sliderY.value = 100 + self.slidersValueChanged(nil) + + chartView.animate(xAxisDuration: 1.4, easingOption: .easeOutBack) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let entries = (0.. PieChartDataEntry in + // IMPORTANT: In a PieChart, no values (Entry) should have the same xIndex (even if from different DataSets), since no values can be drawn above each other. + return PieChartDataEntry(value: Double(arc4random_uniform(range) + range / 5), + label: parties[i % parties.count], + icon: #imageLiteral(resourceName: "icon")) + } + + let set = PieChartDataSet(values: entries, label: "Election Results") + set.drawIconsEnabled = false + set.sliceSpace = 2 + + + set.colors = ChartColorTemplates.vordiplom() + + ChartColorTemplates.joyful() + + ChartColorTemplates.colorful() + + ChartColorTemplates.liberty() + + ChartColorTemplates.pastel() + + [UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)] + + let data = PieChartData(dataSet: set) + + let pFormatter = NumberFormatter() + pFormatter.numberStyle = .percent + pFormatter.maximumFractionDigits = 1 + pFormatter.multiplier = 1 + pFormatter.percentSymbol = " %" + data.setValueFormatter(DefaultValueFormatter(formatter: pFormatter)) + + data.setValueFont(.systemFont(ofSize: 11, weight: .light)) + data.setValueTextColor(.white) + + chartView.data = data + chartView.highlightValues(nil) + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleXValues: + chartView.drawEntryLabelsEnabled = !chartView.drawEntryLabelsEnabled + chartView.setNeedsDisplay() + + case .togglePercent: + chartView.usePercentValuesEnabled = !chartView.usePercentValuesEnabled + chartView.setNeedsDisplay() + + case .toggleHole: + chartView.drawHoleEnabled = !chartView.drawHoleEnabled + chartView.setNeedsDisplay() + + case .drawCenter: + chartView.drawCenterTextEnabled = !chartView.drawCenterTextEnabled + chartView.setNeedsDisplay() + + case .animateX: + chartView.animate(xAxisDuration: 1.4) + + case .animateY: + chartView.animate(yAxisDuration: 1.4) + + case .animateXY: + chartView.animate(xAxisDuration: 1.4, yAxisDuration: 1.4) + + case .spin: + chartView.spin(duration: 2, + fromAngle: chartView.rotationAngle, + toAngle: chartView.rotationAngle + 360, + easingOption: .easeInCubic) + + default: + handleOption(option, forChartView: chartView) + } + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/PiePolylineChartViewController.swift b/ChartsDemo/Swift/Demos/PiePolylineChartViewController.swift new file mode 100644 index 0000000000..5b48713b2f --- /dev/null +++ b/ChartsDemo/Swift/Demos/PiePolylineChartViewController.swift @@ -0,0 +1,145 @@ +// +// PiePolylineChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class PiePolylineChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: PieChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Pie Bar Chart" + + self.options = [.toggleValues, + .toggleXValues, + .togglePercent, + .toggleHole, + .animateX, + .animateY, + .animateXY, + .spin, + .drawCenter, + .saveToGallery, + .toggleData] + + self.setup(pieChartView: chartView) + + chartView.delegate = self + + chartView.legend.enabled = false + chartView.setExtraOffsets(left: 20, top: 0, right: 20, bottom: 0) + + sliderX.value = 40 + sliderY.value = 100 + self.slidersValueChanged(nil) + + chartView.animate(xAxisDuration: 1.4, easingOption: .easeOutBack) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let entries = (0.. PieChartDataEntry in + // IMPORTANT: In a PieChart, no values (Entry) should have the same xIndex (even if from different DataSets), since no values can be drawn above each other. + return PieChartDataEntry(value: Double(arc4random_uniform(range) + range / 5), + label: parties[i % parties.count]) + } + + let set = PieChartDataSet(values: entries, label: "Election Results") + set.sliceSpace = 2 + + + set.colors = ChartColorTemplates.vordiplom() + + ChartColorTemplates.joyful() + + ChartColorTemplates.colorful() + + ChartColorTemplates.liberty() + + ChartColorTemplates.pastel() + + [UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)] + + set.valueLinePart1OffsetPercentage = 0.8 + set.valueLinePart1Length = 0.2 + set.valueLinePart2Length = 0.4 + //set.xValuePosition = .outsideSlice + set.yValuePosition = .outsideSlice + + let data = PieChartData(dataSet: set) + + let pFormatter = NumberFormatter() + pFormatter.numberStyle = .percent + pFormatter.maximumFractionDigits = 1 + pFormatter.multiplier = 1 + pFormatter.percentSymbol = " %" + data.setValueFormatter(DefaultValueFormatter(formatter: pFormatter)) + data.setValueFont(.systemFont(ofSize: 11, weight: .light)) + data.setValueTextColor(.black) + + chartView.data = data + chartView.highlightValues(nil) + } + + override func optionTapped(_ option: Option) { + switch option { + case .toggleXValues: + chartView.drawEntryLabelsEnabled = !chartView.drawEntryLabelsEnabled + chartView.setNeedsDisplay() + + case .togglePercent: + chartView.usePercentValuesEnabled = !chartView.usePercentValuesEnabled + chartView.setNeedsDisplay() + + case .toggleHole: + chartView.drawHoleEnabled = !chartView.drawHoleEnabled + chartView.setNeedsDisplay() + + case .drawCenter: + chartView.drawCenterTextEnabled = !chartView.drawCenterTextEnabled + chartView.setNeedsDisplay() + + case .animateX: + chartView.animate(xAxisDuration: 1.4) + + case .animateY: + chartView.animate(yAxisDuration: 1.4) + + case .animateXY: + chartView.animate(xAxisDuration: 1.4, yAxisDuration: 1.4) + + case .spin: + chartView.spin(duration: 2, + fromAngle: chartView.rotationAngle, + toAngle: chartView.rotationAngle + 360, + easingOption: .easeInCubic) + + default: + handleOption(option, forChartView: chartView) + } + } + + // MARK: - Actions + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/PositiveNegativeBarChartViewController.swift b/ChartsDemo/Swift/Demos/PositiveNegativeBarChartViewController.swift new file mode 100644 index 0000000000..6d363dec0c --- /dev/null +++ b/ChartsDemo/Swift/Demos/PositiveNegativeBarChartViewController.swift @@ -0,0 +1,120 @@ +// +// PositiveNegativeBarChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class PositiveNegativeBarChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: BarChartView! + + let dataLabels = ["12-19", + "12-30", + "12-31", + "01-01", + "01-02"] + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Bar Chart" + self.options = [.toggleValues, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData, + .toggleBarBorders] + + self.setup(barLineChartView: chartView) + + chartView.delegate = self + + chartView.setExtraOffsets(left: 70, top: -30, right: 70, bottom: 10) + + chartView.drawBarShadowEnabled = false + chartView.drawValueAboveBarEnabled = true + + chartView.chartDescription?.enabled = false + + chartView.rightAxis.enabled = false + + let xAxis = chartView.xAxis + xAxis.labelPosition = .bottom + xAxis.labelFont = .systemFont(ofSize: 13) + xAxis.drawAxisLineEnabled = false + xAxis.labelTextColor = .lightGray + xAxis.labelCount = 5 + xAxis.centerAxisLabelsEnabled = true + xAxis.granularity = 1 + xAxis.valueFormatter = self + + let leftAxis = chartView.leftAxis + leftAxis.drawLabelsEnabled = false + leftAxis.spaceTop = 0.25 + leftAxis.spaceBottom = 0.25 + leftAxis.drawAxisLineEnabled = false + leftAxis.drawZeroLineEnabled = true + leftAxis.zeroLineColor = .gray + leftAxis.zeroLineWidth = 0.7 + + self.updateChartData() + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setChartData() + } + + func setChartData() { + let yVals = [BarChartDataEntry(x: 0, y: -224.1), + BarChartDataEntry(x: 1, y: 238.5), + BarChartDataEntry(x: 2, y: 1280.1), + BarChartDataEntry(x: 3, y: -442.3), + BarChartDataEntry(x: 4, y: -2280.1) + ] + + let red = UIColor(red: 211/255, green: 74/255, blue: 88/255, alpha: 1) + let green = UIColor(red: 110/255, green: 190/255, blue: 102/255, alpha: 1) + let colors = yVals.map { (entry) -> NSUIColor in + return entry.y > 0 ? red : green + } + + let set = BarChartDataSet(values: yVals, label: "Values") + set.colors = colors + set.valueColors = colors + + let data = BarChartData(dataSet: set) + data.setValueFont(.systemFont(ofSize: 13)) + + let formatter = NumberFormatter() + formatter.maximumFractionDigits = 1 + data.setValueFormatter(DefaultValueFormatter(formatter: formatter)) + data.barWidth = 0.8 + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } +} + +extension PositiveNegativeBarChartViewController: IAxisValueFormatter { + func stringForValue(_ value: Double, axis: AxisBase?) -> String { + return dataLabels[min(max(Int(value), 0), dataLabels.count - 1)] + } +} diff --git a/ChartsDemo/Swift/Demos/RadarChartViewController.swift b/ChartsDemo/Swift/Demos/RadarChartViewController.swift new file mode 100644 index 0000000000..f90bb74c6c --- /dev/null +++ b/ChartsDemo/Swift/Demos/RadarChartViewController.swift @@ -0,0 +1,203 @@ +// +// RadarChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class RadarChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: RadarChartView! + + let activities = ["Burger", "Steak", "Salad", "Pasta", "Pizza"] + var originalBarBgColor: UIColor! + var originalBarTintColor: UIColor! + var originalBarStyle: UIBarStyle! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Radar Bar Chart" + self.options = [.toggleValues, + .toggleHighlight, + .toggleHighlightCircle, + .toggleXLabels, + .toggleYLabels, + .toggleRotate, + .toggleFilled, + .animateX, + .animateY, + .animateXY, + .spin, + .saveToGallery, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + chartView.webLineWidth = 1 + chartView.innerWebLineWidth = 1 + chartView.webColor = .lightGray + chartView.innerWebColor = .lightGray + chartView.webAlpha = 1 + + let marker = RadarMarkerView.viewFromXib()! + marker.chartView = chartView + chartView.marker = marker + + let xAxis = chartView.xAxis + xAxis.labelFont = .systemFont(ofSize: 9, weight: .light) + xAxis.xOffset = 0 + xAxis.yOffset = 0 + xAxis.valueFormatter = self + xAxis.labelTextColor = .white + + let yAxis = chartView.yAxis + yAxis.labelFont = .systemFont(ofSize: 9, weight: .light) + yAxis.labelCount = 5 + yAxis.axisMinimum = 0 + yAxis.axisMaximum = 80 + yAxis.drawLabelsEnabled = false + + let l = chartView.legend + l.horizontalAlignment = .center + l.verticalAlignment = .top + l.orientation = .horizontal + l.drawInside = false + l.font = .systemFont(ofSize: 10, weight: .light) + l.xEntrySpace = 7 + l.yEntrySpace = 5 + l.textColor = .white +// chartView.legend = l + + self.updateChartData() + + chartView.animate(xAxisDuration: 1.4, yAxisDuration: 1.4, easingOption: .easeOutBack) + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + UIView.animate(withDuration: 0.15) { + let navBar = self.navigationController!.navigationBar + self.originalBarBgColor = navBar.barTintColor + self.originalBarTintColor = navBar.tintColor + self.originalBarStyle = navBar.barStyle + + navBar.barTintColor = self.view.backgroundColor + navBar.tintColor = .white + navBar.barStyle = .black + } + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + UIView.animate(withDuration: 0.15) { + let navBar = self.navigationController!.navigationBar + navBar.barTintColor = self.originalBarBgColor + navBar.tintColor = self.originalBarTintColor + navBar.barStyle = self.originalBarStyle + } + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setChartData() + } + + func setChartData() { + let mult: UInt32 = 80 + let min: UInt32 = 20 + let cnt = 5 + + let block: (Int) -> RadarChartDataEntry = { _ in return RadarChartDataEntry(value: Double(arc4random_uniform(mult) + min))} + let entries1 = (0.. String { + return activities[Int(value) % activities.count] + } +} diff --git a/ChartsDemo/Swift/Demos/ScatterChartViewController.swift b/ChartsDemo/Swift/Demos/ScatterChartViewController.swift new file mode 100644 index 0000000000..2dea8e3627 --- /dev/null +++ b/ChartsDemo/Swift/Demos/ScatterChartViewController.swift @@ -0,0 +1,124 @@ +// +// ScatterChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class ScatterChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: ScatterChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderY: UISlider! + @IBOutlet var sliderTextX: UITextField! + @IBOutlet var sliderTextY: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Scatter Bar Chart" + self.options = [.toggleValues, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.dragEnabled = true + chartView.setScaleEnabled(true) + chartView.maxVisibleCount = 200 + chartView.pinchZoomEnabled = true + + let l = chartView.legend + l.horizontalAlignment = .right + l.verticalAlignment = .top + l.orientation = .vertical + l.drawInside = false + l.font = .systemFont(ofSize: 10, weight: .light) + l.xOffset = 5 + + let leftAxis = chartView.leftAxis + leftAxis.labelFont = .systemFont(ofSize: 10, weight: .light) + leftAxis.axisMinimum = 0 + + chartView.rightAxis.enabled = false + + + let xAxis = chartView.xAxis + xAxis.labelFont = .systemFont(ofSize: 10, weight: .light) + + sliderX.value = 45 + sliderY.value = 100 + slidersValueChanged(nil) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value + 1), range: UInt32(sliderY.value)) + } + + func setDataCount(_ count: Int, range: UInt32) { + let values1 = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 3) + return ChartDataEntry(x: Double(i), y: val) + } + let values2 = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 3) + return ChartDataEntry(x: Double(i) + 0.33, y: val) + } + let values3 = (0.. ChartDataEntry in + let val = Double(arc4random_uniform(range) + 3) + return ChartDataEntry(x: Double(i) + 0.66, y: val) + } + + + let set1 = ScatterChartDataSet(values: values1, label: "DS 1") + set1.setScatterShape(.square) + set1.setColor(ChartColorTemplates.colorful()[0]) + set1.scatterShapeSize = 8 + + let set2 = ScatterChartDataSet(values: values2, label: "DS 2") + set2.setScatterShape(.circle) + set2.scatterShapeHoleColor = ChartColorTemplates.colorful()[3] + set2.scatterShapeHoleRadius = 3.5 + set2.setColor(ChartColorTemplates.colorful()[1]) + set2.scatterShapeSize = 8 + + let set3 = ScatterChartDataSet(values: values3, label: "DS 3") + set3.setScatterShape(.cross) + set3.setColor(ChartColorTemplates.colorful()[2]) + set3.scatterShapeSize = 8 + + let data = ScatterChartData(dataSets: [set1, set2, set3]) + data.setValueFont(.systemFont(ofSize: 7, weight: .light)) + + chartView.data = data + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } + + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + self.updateChartData() + } +} diff --git a/ChartsDemo/Swift/Demos/SinusBarChartViewController.swift b/ChartsDemo/Swift/Demos/SinusBarChartViewController.swift new file mode 100644 index 0000000000..790d5c6721 --- /dev/null +++ b/ChartsDemo/Swift/Demos/SinusBarChartViewController.swift @@ -0,0 +1,108 @@ +// +// SinusBarChartViewController.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import UIKit +import Charts + +class SinusBarChartViewController: DemoBaseViewController { + + @IBOutlet var chartView: BarChartView! + @IBOutlet var sliderX: UISlider! + @IBOutlet var sliderTextX: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.title = "Line Chart 2" + self.options = [.toggleValues, + .toggleHighlight, + .animateX, + .animateY, + .animateXY, + .saveToGallery, + .togglePinchZoom, + .toggleAutoScaleMinMax, + .toggleData] + + chartView.delegate = self + + chartView.chartDescription?.enabled = false + + chartView.drawBarShadowEnabled = false + chartView.drawValueAboveBarEnabled = false + chartView.maxVisibleCount = 60 + + let xAxis = chartView.xAxis + xAxis.labelPosition = .bottom + xAxis.enabled = false + + let leftAxis = chartView.leftAxis + leftAxis.labelCount = 6 + leftAxis.axisMinimum = -2.5 + leftAxis.axisMaximum = 2.5 + leftAxis.granularityEnabled = true + leftAxis.granularity = 0.1 + + let rightAxis = chartView.rightAxis + rightAxis.labelCount = 6 + rightAxis.axisMinimum = -2.5 + rightAxis.axisMaximum = 2.5 + rightAxis.granularity = 0.1 + + let l = chartView.legend + l.horizontalAlignment = .left + l.verticalAlignment = .bottom + l.orientation = .horizontal + l.drawInside = false + l.form = .square + l.formSize = 9 + l.font = .systemFont(ofSize: 11) + l.xEntrySpace = 4 +// chartView.legend = l + + sliderX.value = 150 + slidersValueChanged(nil) + + chartView.animate(xAxisDuration: 2, yAxisDuration: 2) + } + + override func updateChartData() { + if self.shouldHideData { + chartView.data = nil + return + } + + self.setDataCount(Int(sliderX.value)) + } + + func setDataCount(_ count: Int) { + let entries = (0.. BarChartDataEntry in + let mult = range + 1 + let val1 = Double(arc4random_uniform(mult) + mult / 3) + let val2 = Double(arc4random_uniform(mult) + mult / 3) + let val3 = Double(arc4random_uniform(mult) + mult / 3) + + return BarChartDataEntry(x: Double(i), yValues: [val1, val2, val3], icon: #imageLiteral(resourceName: "icon")) + } + + let set = BarChartDataSet(values: yVals, label: "Statistics Vienna 2014") + set.drawIconsEnabled = false + set.colors = [ChartColorTemplates.material()[0], ChartColorTemplates.material()[1], ChartColorTemplates.material()[2]] + set.stackLabels = ["Births", "Divorces", "Marriages"] + + let data = BarChartData(dataSet: set) + data.setValueFont(.systemFont(ofSize: 7, weight: .light)) + data.setValueFormatter(DefaultValueFormatter(formatter: formatter)) + data.setValueTextColor(.white) + + chartView.fitBars = true + chartView.data = data + } + + override func optionTapped(_ option: Option) { + super.handleOption(option, forChartView: chartView) + } + + @IBAction func slidersValueChanged(_ sender: Any?) { + sliderTextX.text = "\(Int(sliderX.value))" + sliderTextY.text = "\(Int(sliderY.value))" + + updateChartData() + } +} diff --git a/ChartsDemo/Swift/Formatters/DateValueFormatter.swift b/ChartsDemo/Swift/Formatters/DateValueFormatter.swift new file mode 100644 index 0000000000..2962a6852a --- /dev/null +++ b/ChartsDemo/Swift/Formatters/DateValueFormatter.swift @@ -0,0 +1,23 @@ +// +// DateValueFormatter.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import Foundation +import Charts + +public class DateValueFormatter: NSObject, IAxisValueFormatter { + private let dateFormatter = DateFormatter() + + override init() { + super.init() + dateFormatter.dateFormat = "dd MMM HH:mm" + } + + public func stringForValue(_ value: Double, axis: AxisBase?) -> String { + return dateFormatter.string(from: Date(timeIntervalSince1970: value)) + } +} diff --git a/ChartsDemo/Swift/Formatters/DayAxisValueFormatter.swift b/ChartsDemo/Swift/Formatters/DayAxisValueFormatter.swift new file mode 100644 index 0000000000..245a25c83e --- /dev/null +++ b/ChartsDemo/Swift/Formatters/DayAxisValueFormatter.swift @@ -0,0 +1,109 @@ +// +// DayAxisValueFormatter.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import Foundation +import Charts + +public class DayAxisValueFormatter: NSObject, IAxisValueFormatter { + weak var chart: BarLineChartViewBase? + let months = ["Jan", "Feb", "Mar", + "Apr", "May", "Jun", + "Jul", "Aug", "Sep", + "Oct", "Nov", "Dec"] + + init(chart: BarLineChartViewBase) { + self.chart = chart + } + + public func stringForValue(_ value: Double, axis: AxisBase?) -> String { + let days = Int(value) + let year = determineYear(forDays: days) + let month = determineMonth(forDayOfYear: days) + + let monthName = months[month % months.count] + let yearName = "\(year)" + + if let chart = chart, + chart.visibleXRange > 30 * 6 { + return monthName + yearName + } else { + let dayOfMonth = determineDayOfMonth(forDays: days, month: month + 12 * (year - 2016)) + var appendix: String + + switch dayOfMonth { + case 1, 21, 31: appendix = "st" + case 2, 22: appendix = "nd" + case 3, 23: appendix = "rd" + default: appendix = "th" + } + + return dayOfMonth == 0 ? "" : String(format: "%d\(appendix) \(monthName)", dayOfMonth) + } + } + + private func days(forMonth month: Int, year: Int) -> Int { + // month is 0-based + switch month { + case 1: + var is29Feb = false + if year < 1582 { + is29Feb = (year < 1 ? year + 1 : year) % 4 == 0 + } else if year > 1582 { + is29Feb = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0) + } + + return is29Feb ? 29 : 28 + + case 3, 5, 8, 10: + return 30 + + default: + return 31 + } + } + + private func determineMonth(forDayOfYear dayOfYear: Int) -> Int { + var month = -1 + var days = 0 + + while days < dayOfYear { + month += 1 + if month >= 12 { + month = 0 + } + + let year = determineYear(forDays: days) + days += self.days(forMonth: month, year: year) + } + + return max(month, 0) + } + + private func determineDayOfMonth(forDays days: Int, month: Int) -> Int { + var count = 0 + var daysForMonth = 0 + + while count < month { + let year = determineYear(forDays: days) + daysForMonth += self.days(forMonth: count % 12, year: year) + count += 1 + } + + return days - daysForMonth + } + + private func determineYear(forDays days: Int) -> Int { + switch days { + case ...366: return 2016 + case 367...730: return 2017 + case 731...1094: return 2018 + case 1095...1458: return 2019 + default: return 2020 + } + } +} diff --git a/ChartsDemo/Swift/Formatters/IntAxisValueFormatter.swift b/ChartsDemo/Swift/Formatters/IntAxisValueFormatter.swift new file mode 100644 index 0000000000..bd3062a190 --- /dev/null +++ b/ChartsDemo/Swift/Formatters/IntAxisValueFormatter.swift @@ -0,0 +1,16 @@ +// +// IntAxisValueFormatter.swift +// ChartsDemo-iOS +// +// Created by Jacob Christie on 2017-07-09. +// Copyright © 2017 jc. All rights reserved. +// + +import Foundation +import Charts + +public class IntAxisValueFormatter: NSObject, IAxisValueFormatter { + public func stringForValue(_ value: Double, axis: AxisBase?) -> String { + return "\(Int(value))" + } +} diff --git a/ChartsDemo/Swift/Formatters/LargeValueFormatter.swift b/ChartsDemo/Swift/Formatters/LargeValueFormatter.swift new file mode 100644 index 0000000000..c95ca034a6 --- /dev/null +++ b/ChartsDemo/Swift/Formatters/LargeValueFormatter.swift @@ -0,0 +1,58 @@ +// +// LargeValueFormatter.swift +// ChartsDemo +// Copyright © 2016 dcg. All rights reserved. +// + +import Foundation +import Charts + +private let MAX_LENGTH = 5 + +@objc protocol Testing123 { } + +public class LargeValueFormatter: NSObject, IValueFormatter, IAxisValueFormatter { + + /// Suffix to be appended after the values. + /// + /// **default**: suffix: ["", "k", "m", "b", "t"] + public var suffix = ["", "k", "m", "b", "t"] + + /// An appendix text to be added at the end of the formatted value. + public var appendix: String? + + public init(appendix: String? = nil) { + self.appendix = appendix + } + + fileprivate func format(value: Double) -> String { + var sig = value + var length = 0 + let maxLength = suffix.count - 1 + + while sig >= 1000.0 && length < maxLength { + sig /= 1000.0 + length += 1 + } + + var r = String(format: "%2.f", sig) + suffix[length] + + if let appendix = appendix { + r += appendix + } + + return r + } + + public func stringForValue(_ value: Double, axis: AxisBase?) -> String { + return format(value: value) + } + + public func stringForValue( + _ value: Double, + entry: ChartDataEntry, + dataSetIndex: Int, + viewPortHandler: ViewPortHandler?) -> String { + return format(value: value) + } +} diff --git a/ChartsDemo/Classes/DemoListViewController.xib b/ChartsDemo/XIBs/DemoListViewController.xib similarity index 90% rename from ChartsDemo/Classes/DemoListViewController.xib rename to ChartsDemo/XIBs/DemoListViewController.xib index 8c1fb6664a..651bae9f4c 100644 --- a/ChartsDemo/Classes/DemoListViewController.xib +++ b/ChartsDemo/XIBs/DemoListViewController.xib @@ -1,16 +1,15 @@ - + - - + - + diff --git a/ChartsDemo/Classes/Demos/AnotherBarChartViewController.xib b/ChartsDemo/XIBs/Demos/AnotherBarChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/AnotherBarChartViewController.xib rename to ChartsDemo/XIBs/Demos/AnotherBarChartViewController.xib index 67b6b0ff66..571312c92c 100644 --- a/ChartsDemo/Classes/Demos/AnotherBarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/AnotherBarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/BarChartViewController.xib b/ChartsDemo/XIBs/Demos/BarChartViewController.xib similarity index 96% rename from ChartsDemo/Classes/Demos/BarChartViewController.xib rename to ChartsDemo/XIBs/Demos/BarChartViewController.xib index a80597e1e1..85dbdc8371 100644 --- a/ChartsDemo/Classes/Demos/BarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/BarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/BubbleChartViewController.xib b/ChartsDemo/XIBs/Demos/BubbleChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/BubbleChartViewController.xib rename to ChartsDemo/XIBs/Demos/BubbleChartViewController.xib index 8e6c7a5e56..03af886339 100644 --- a/ChartsDemo/Classes/Demos/BubbleChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/BubbleChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/CandleStickChartViewController.xib b/ChartsDemo/XIBs/Demos/CandleStickChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/CandleStickChartViewController.xib rename to ChartsDemo/XIBs/Demos/CandleStickChartViewController.xib index f12abdfc1d..460c052371 100644 --- a/ChartsDemo/Classes/Demos/CandleStickChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/CandleStickChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/ColoredLineChartViewController.xib b/ChartsDemo/XIBs/Demos/ColoredLineChartViewController.xib similarity index 92% rename from ChartsDemo/Classes/Demos/ColoredLineChartViewController.xib rename to ChartsDemo/XIBs/Demos/ColoredLineChartViewController.xib index c5969e1434..ef099b9fd9 100644 --- a/ChartsDemo/Classes/Demos/ColoredLineChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/ColoredLineChartViewController.xib @@ -1,22 +1,21 @@ - + - - + - + - - - - + + + + diff --git a/ChartsDemo/Classes/Demos/CombinedChartViewController.xib b/ChartsDemo/XIBs/Demos/CombinedChartViewController.xib similarity index 94% rename from ChartsDemo/Classes/Demos/CombinedChartViewController.xib rename to ChartsDemo/XIBs/Demos/CombinedChartViewController.xib index 31e5bdfaef..82fe07e540 100644 --- a/ChartsDemo/Classes/Demos/CombinedChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/CombinedChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/CubicLineChartViewController.xib b/ChartsDemo/XIBs/Demos/CubicLineChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/CubicLineChartViewController.xib rename to ChartsDemo/XIBs/Demos/CubicLineChartViewController.xib index 3f86d792bc..007e470e21 100644 --- a/ChartsDemo/Classes/Demos/CubicLineChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/CubicLineChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/HalfPieChartViewController.xib b/ChartsDemo/XIBs/Demos/HalfPieChartViewController.xib similarity index 94% rename from ChartsDemo/Classes/Demos/HalfPieChartViewController.xib rename to ChartsDemo/XIBs/Demos/HalfPieChartViewController.xib index 2750f4e64a..cdcf1ffe65 100644 --- a/ChartsDemo/Classes/Demos/HalfPieChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/HalfPieChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/HorizontalBarChartViewController.xib b/ChartsDemo/XIBs/Demos/HorizontalBarChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/HorizontalBarChartViewController.xib rename to ChartsDemo/XIBs/Demos/HorizontalBarChartViewController.xib index fc1fd2bb7d..7ea8e71202 100644 --- a/ChartsDemo/Classes/Demos/HorizontalBarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/HorizontalBarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/LineChart1ViewController.xib b/ChartsDemo/XIBs/Demos/LineChart1ViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/LineChart1ViewController.xib rename to ChartsDemo/XIBs/Demos/LineChart1ViewController.xib index 03ec930fb2..9902b5b27d 100644 --- a/ChartsDemo/Classes/Demos/LineChart1ViewController.xib +++ b/ChartsDemo/XIBs/Demos/LineChart1ViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/LineChart2ViewController.xib b/ChartsDemo/XIBs/Demos/LineChart2ViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/LineChart2ViewController.xib rename to ChartsDemo/XIBs/Demos/LineChart2ViewController.xib index 0fa259d36b..c1c730e97b 100644 --- a/ChartsDemo/Classes/Demos/LineChart2ViewController.xib +++ b/ChartsDemo/XIBs/Demos/LineChart2ViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/LineChartFilledViewController.xib b/ChartsDemo/XIBs/Demos/LineChartFilledViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/LineChartFilledViewController.xib rename to ChartsDemo/XIBs/Demos/LineChartFilledViewController.xib index ab13b21438..62bf7015e6 100644 --- a/ChartsDemo/Classes/Demos/LineChartFilledViewController.xib +++ b/ChartsDemo/XIBs/Demos/LineChartFilledViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/LineChartTimeViewController.xib b/ChartsDemo/XIBs/Demos/LineChartTimeViewController.xib similarity index 96% rename from ChartsDemo/Classes/Demos/LineChartTimeViewController.xib rename to ChartsDemo/XIBs/Demos/LineChartTimeViewController.xib index c4bfdb5447..d13233af3f 100644 --- a/ChartsDemo/Classes/Demos/LineChartTimeViewController.xib +++ b/ChartsDemo/XIBs/Demos/LineChartTimeViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/MultipleBarChartViewController.xib b/ChartsDemo/XIBs/Demos/MultipleBarChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/MultipleBarChartViewController.xib rename to ChartsDemo/XIBs/Demos/MultipleBarChartViewController.xib index 82d926249b..9ee6745abc 100644 --- a/ChartsDemo/Classes/Demos/MultipleBarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/MultipleBarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/MultipleLinesChartViewController.xib b/ChartsDemo/XIBs/Demos/MultipleLinesChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/MultipleLinesChartViewController.xib rename to ChartsDemo/XIBs/Demos/MultipleLinesChartViewController.xib index ab3f88a207..c9595f1dc4 100644 --- a/ChartsDemo/Classes/Demos/MultipleLinesChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/MultipleLinesChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/NegativeStackedBarChartViewController.xib b/ChartsDemo/XIBs/Demos/NegativeStackedBarChartViewController.xib similarity index 94% rename from ChartsDemo/Classes/Demos/NegativeStackedBarChartViewController.xib rename to ChartsDemo/XIBs/Demos/NegativeStackedBarChartViewController.xib index 3fad1f0a2b..ac24e0d3c9 100644 --- a/ChartsDemo/Classes/Demos/NegativeStackedBarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/NegativeStackedBarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/PieChartViewController.xib b/ChartsDemo/XIBs/Demos/PieChartViewController.xib similarity index 96% rename from ChartsDemo/Classes/Demos/PieChartViewController.xib rename to ChartsDemo/XIBs/Demos/PieChartViewController.xib index a302811fad..39cce57ef3 100644 --- a/ChartsDemo/Classes/Demos/PieChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/PieChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/PiePolylineChartViewController.xib b/ChartsDemo/XIBs/Demos/PiePolylineChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/PiePolylineChartViewController.xib rename to ChartsDemo/XIBs/Demos/PiePolylineChartViewController.xib index cccc27431b..c0bc4dbb86 100644 --- a/ChartsDemo/Classes/Demos/PiePolylineChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/PiePolylineChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/PositiveNegativeBarChartViewController.xib b/ChartsDemo/XIBs/Demos/PositiveNegativeBarChartViewController.xib similarity index 94% rename from ChartsDemo/Classes/Demos/PositiveNegativeBarChartViewController.xib rename to ChartsDemo/XIBs/Demos/PositiveNegativeBarChartViewController.xib index 5620b00f20..365f7f6337 100644 --- a/ChartsDemo/Classes/Demos/PositiveNegativeBarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/PositiveNegativeBarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/RadarChartViewController.xib b/ChartsDemo/XIBs/Demos/RadarChartViewController.xib similarity index 96% rename from ChartsDemo/Classes/Demos/RadarChartViewController.xib rename to ChartsDemo/XIBs/Demos/RadarChartViewController.xib index c583828242..3e45cbe67d 100644 --- a/ChartsDemo/Classes/Demos/RadarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/RadarChartViewController.xib @@ -1,11 +1,11 @@ - + - + @@ -16,7 +16,7 @@ - + diff --git a/ChartsDemo/Classes/RealmDemosViewController.xib b/ChartsDemo/XIBs/Demos/RealmDemosViewController.xib similarity index 93% rename from ChartsDemo/Classes/RealmDemosViewController.xib rename to ChartsDemo/XIBs/Demos/RealmDemosViewController.xib index b15cd41f15..9e6861347a 100644 --- a/ChartsDemo/Classes/RealmDemosViewController.xib +++ b/ChartsDemo/XIBs/Demos/RealmDemosViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/ScatterChartViewController.xib b/ChartsDemo/XIBs/Demos/ScatterChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/ScatterChartViewController.xib rename to ChartsDemo/XIBs/Demos/ScatterChartViewController.xib index a5b0dcea1d..926e15c0df 100644 --- a/ChartsDemo/Classes/Demos/ScatterChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/ScatterChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/SinusBarChartViewController.xib b/ChartsDemo/XIBs/Demos/SinusBarChartViewController.xib similarity index 96% rename from ChartsDemo/Classes/Demos/SinusBarChartViewController.xib rename to ChartsDemo/XIBs/Demos/SinusBarChartViewController.xib index ebe1d48687..e2c84ecf6f 100644 --- a/ChartsDemo/Classes/Demos/SinusBarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/SinusBarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Demos/StackedBarChartViewController.xib b/ChartsDemo/XIBs/Demos/StackedBarChartViewController.xib similarity index 97% rename from ChartsDemo/Classes/Demos/StackedBarChartViewController.xib rename to ChartsDemo/XIBs/Demos/StackedBarChartViewController.xib index b162c60b82..cb9e5c20e2 100644 --- a/ChartsDemo/Classes/Demos/StackedBarChartViewController.xib +++ b/ChartsDemo/XIBs/Demos/StackedBarChartViewController.xib @@ -1,12 +1,11 @@ - + - - + @@ -15,7 +14,7 @@ - + diff --git a/ChartsDemo/Classes/Components/RadarMarkerView.xib b/ChartsDemo/XIBs/RadarMarkerView.xib similarity index 80% rename from ChartsDemo/Classes/Components/RadarMarkerView.xib rename to ChartsDemo/XIBs/RadarMarkerView.xib index a515cc9ca9..8ffdb62c0d 100644 --- a/ChartsDemo/Classes/Components/RadarMarkerView.xib +++ b/ChartsDemo/XIBs/RadarMarkerView.xib @@ -1,22 +1,31 @@ - - + + + + + - + + + + HelveticaNeue-Light + + - + - +