├── AnyChartObjCSample.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── AnyChartObjCSample ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── MainIPad.storyboard ├── Classes │ ├── ByIndustryViewController.h │ ├── ByIndustryViewController.m │ ├── ByProductViewController.h │ ├── ByProductViewController.m │ ├── ByQuarterViewController.h │ ├── ByQuarterViewController.m │ ├── BySalesRepViewController.h │ ├── BySalesRepViewController.m │ ├── ChartBaseViewController.h │ ├── ChartBaseViewController.m │ ├── Data.h │ ├── Data.m │ ├── Filters.h │ ├── Filters.m │ ├── FiltersViewController.h │ ├── FiltersViewController.m │ ├── IdNameModel.h │ ├── IdNameModel.m │ ├── Industry.h │ ├── Industry.m │ ├── Product.h │ ├── Product.m │ ├── Region.h │ ├── Region.m │ ├── SalesRep.h │ └── SalesRep.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── MainIPhone.storyboard ├── MainViewController.h ├── MainViewController.m ├── bar.html ├── charts.html ├── column.html ├── line.html ├── main.m └── pie.html ├── LICENSE ├── Podfile ├── README.md ├── ipad.gif └── iphone.gif /AnyChartObjCSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C46A68296567EFB0307B539E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A35448378BD88EDD8A3A92B /* libPods.a */; }; 11 | FA01B8D51BAFA78E009510F3 /* Filters.m in Sources */ = {isa = PBXBuildFile; fileRef = FA01B8D41BAFA78E009510F3 /* Filters.m */; }; 12 | FA01B8D81BAFBC7A009510F3 /* IdNameModel.m in Sources */ = {isa = PBXBuildFile; fileRef = FA01B8D71BAFBC7A009510F3 /* IdNameModel.m */; }; 13 | FA958A4F1BABBAF6005562C9 /* charts.html in Resources */ = {isa = PBXBuildFile; fileRef = FA958A4E1BABBAF6005562C9 /* charts.html */; }; 14 | FAB0D5861BAA624A0095AEDB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D5851BAA624A0095AEDB /* main.m */; }; 15 | FAB0D5891BAA624A0095AEDB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D5881BAA624A0095AEDB /* AppDelegate.m */; }; 16 | FAB0D58C1BAA624A0095AEDB /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D58B1BAA624A0095AEDB /* MainViewController.m */; }; 17 | FAB0D58F1BAA624A0095AEDB /* MainIPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FAB0D58D1BAA624A0095AEDB /* MainIPad.storyboard */; }; 18 | FAB0D5911BAA624A0095AEDB /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FAB0D5901BAA624A0095AEDB /* Images.xcassets */; }; 19 | FAB0D5941BAA624A0095AEDB /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = FAB0D5921BAA624A0095AEDB /* LaunchScreen.xib */; }; 20 | FAB0D5AD1BAA626E0095AEDB /* Data.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D5AC1BAA626E0095AEDB /* Data.m */; }; 21 | FAB0D5B31BAA77D60095AEDB /* Product.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D5B21BAA77D60095AEDB /* Product.m */; }; 22 | FAB0D5B71BAA781F0095AEDB /* Industry.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D5B61BAA781F0095AEDB /* Industry.m */; }; 23 | FAB0D5BA1BAA785A0095AEDB /* Region.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D5B91BAA785A0095AEDB /* Region.m */; }; 24 | FAB0D5BD1BAA78740095AEDB /* SalesRep.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB0D5BC1BAA78740095AEDB /* SalesRep.m */; }; 25 | FAB6EED81BB8DB3800E5F947 /* bar.html in Resources */ = {isa = PBXBuildFile; fileRef = FAB6EED71BB8DB3800E5F947 /* bar.html */; settings = {ASSET_TAGS = (); }; }; 26 | FAB6EEDA1BB8DC6100E5F947 /* column.html in Resources */ = {isa = PBXBuildFile; fileRef = FAB6EED91BB8DC6100E5F947 /* column.html */; settings = {ASSET_TAGS = (); }; }; 27 | FAB6EEDC1BB8DC9600E5F947 /* pie.html in Resources */ = {isa = PBXBuildFile; fileRef = FAB6EEDB1BB8DC9600E5F947 /* pie.html */; settings = {ASSET_TAGS = (); }; }; 28 | FAB6EEE01BB8DCC200E5F947 /* line.html in Resources */ = {isa = PBXBuildFile; fileRef = FAB6EEDF1BB8DCC200E5F947 /* line.html */; settings = {ASSET_TAGS = (); }; }; 29 | FAB6EEE21BB8DD4B00E5F947 /* MainIPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FAB6EEE11BB8DD4B00E5F947 /* MainIPhone.storyboard */; settings = {ASSET_TAGS = (); }; }; 30 | FAB6EEE51BB8DDE400E5F947 /* ChartBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB6EEE41BB8DDE400E5F947 /* ChartBaseViewController.m */; settings = {ASSET_TAGS = (); }; }; 31 | FAB6EEE91BB8E1EF00E5F947 /* ByIndustryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB6EEE81BB8E1EF00E5F947 /* ByIndustryViewController.m */; settings = {ASSET_TAGS = (); }; }; 32 | FAB6EEEC1BB8E2E100E5F947 /* ByProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB6EEEB1BB8E2E100E5F947 /* ByProductViewController.m */; settings = {ASSET_TAGS = (); }; }; 33 | FAB6EEEF1BB8E33300E5F947 /* BySalesRepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB6EEEE1BB8E33300E5F947 /* BySalesRepViewController.m */; settings = {ASSET_TAGS = (); }; }; 34 | FAB6EEF21BB8E39500E5F947 /* ByQuarterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB6EEF11BB8E39500E5F947 /* ByQuarterViewController.m */; settings = {ASSET_TAGS = (); }; }; 35 | FADE042D1BABF1720051DB1E /* FiltersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FADE042C1BABF1720051DB1E /* FiltersViewController.m */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 3D1551B8ED54951273562DCA /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 40 | 6A35448378BD88EDD8A3A92B /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 72A69BB41B6702E9A2F9794C /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 42 | FA01B8D31BAFA78E009510F3 /* Filters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Filters.h; path = Classes/Filters.h; sourceTree = ""; }; 43 | FA01B8D41BAFA78E009510F3 /* Filters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Filters.m; path = Classes/Filters.m; sourceTree = ""; }; 44 | FA01B8D61BAFBC7A009510F3 /* IdNameModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IdNameModel.h; path = Classes/IdNameModel.h; sourceTree = ""; }; 45 | FA01B8D71BAFBC7A009510F3 /* IdNameModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IdNameModel.m; path = Classes/IdNameModel.m; sourceTree = ""; }; 46 | FA958A4E1BABBAF6005562C9 /* charts.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = charts.html; sourceTree = ""; }; 47 | FAB0D5801BAA624A0095AEDB /* AnyChartObjCSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnyChartObjCSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | FAB0D5841BAA624A0095AEDB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | FAB0D5851BAA624A0095AEDB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | FAB0D5871BAA624A0095AEDB /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | FAB0D5881BAA624A0095AEDB /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | FAB0D58A1BAA624A0095AEDB /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 53 | FAB0D58B1BAA624A0095AEDB /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 54 | FAB0D58E1BAA624A0095AEDB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainIPad.storyboard; sourceTree = ""; }; 55 | FAB0D5901BAA624A0095AEDB /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 56 | FAB0D5931BAA624A0095AEDB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 57 | FAB0D5AB1BAA626E0095AEDB /* Data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Data.h; path = Classes/Data.h; sourceTree = ""; }; 58 | FAB0D5AC1BAA626E0095AEDB /* Data.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Data.m; path = Classes/Data.m; sourceTree = ""; }; 59 | FAB0D5B11BAA77D60095AEDB /* Product.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Product.h; path = Classes/Product.h; sourceTree = ""; }; 60 | FAB0D5B21BAA77D60095AEDB /* Product.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Product.m; path = Classes/Product.m; sourceTree = ""; }; 61 | FAB0D5B51BAA781F0095AEDB /* Industry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Industry.h; path = Classes/Industry.h; sourceTree = ""; }; 62 | FAB0D5B61BAA781F0095AEDB /* Industry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Industry.m; path = Classes/Industry.m; sourceTree = ""; }; 63 | FAB0D5B81BAA785A0095AEDB /* Region.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Region.h; path = Classes/Region.h; sourceTree = ""; }; 64 | FAB0D5B91BAA785A0095AEDB /* Region.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Region.m; path = Classes/Region.m; sourceTree = ""; }; 65 | FAB0D5BB1BAA78740095AEDB /* SalesRep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SalesRep.h; path = Classes/SalesRep.h; sourceTree = ""; }; 66 | FAB0D5BC1BAA78740095AEDB /* SalesRep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SalesRep.m; path = Classes/SalesRep.m; sourceTree = ""; }; 67 | FAB6EED71BB8DB3800E5F947 /* bar.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = bar.html; sourceTree = ""; }; 68 | FAB6EED91BB8DC6100E5F947 /* column.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = column.html; sourceTree = ""; }; 69 | FAB6EEDB1BB8DC9600E5F947 /* pie.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = pie.html; sourceTree = ""; }; 70 | FAB6EEDF1BB8DCC200E5F947 /* line.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = line.html; sourceTree = ""; }; 71 | FAB6EEE11BB8DD4B00E5F947 /* MainIPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainIPhone.storyboard; sourceTree = ""; }; 72 | FAB6EEE31BB8DDE400E5F947 /* ChartBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChartBaseViewController.h; path = Classes/ChartBaseViewController.h; sourceTree = ""; }; 73 | FAB6EEE41BB8DDE400E5F947 /* ChartBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ChartBaseViewController.m; path = Classes/ChartBaseViewController.m; sourceTree = ""; }; 74 | FAB6EEE71BB8E1EF00E5F947 /* ByIndustryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ByIndustryViewController.h; path = Classes/ByIndustryViewController.h; sourceTree = ""; }; 75 | FAB6EEE81BB8E1EF00E5F947 /* ByIndustryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ByIndustryViewController.m; path = Classes/ByIndustryViewController.m; sourceTree = ""; }; 76 | FAB6EEEA1BB8E2E100E5F947 /* ByProductViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ByProductViewController.h; path = Classes/ByProductViewController.h; sourceTree = ""; }; 77 | FAB6EEEB1BB8E2E100E5F947 /* ByProductViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ByProductViewController.m; path = Classes/ByProductViewController.m; sourceTree = ""; }; 78 | FAB6EEED1BB8E33300E5F947 /* BySalesRepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BySalesRepViewController.h; path = Classes/BySalesRepViewController.h; sourceTree = ""; }; 79 | FAB6EEEE1BB8E33300E5F947 /* BySalesRepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BySalesRepViewController.m; path = Classes/BySalesRepViewController.m; sourceTree = ""; }; 80 | FAB6EEF01BB8E39500E5F947 /* ByQuarterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ByQuarterViewController.h; path = Classes/ByQuarterViewController.h; sourceTree = ""; }; 81 | FAB6EEF11BB8E39500E5F947 /* ByQuarterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ByQuarterViewController.m; path = Classes/ByQuarterViewController.m; sourceTree = ""; }; 82 | FADE042B1BABF1720051DB1E /* FiltersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FiltersViewController.h; path = Classes/FiltersViewController.h; sourceTree = ""; }; 83 | FADE042C1BABF1720051DB1E /* FiltersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FiltersViewController.m; path = Classes/FiltersViewController.m; sourceTree = ""; }; 84 | /* End PBXFileReference section */ 85 | 86 | /* Begin PBXFrameworksBuildPhase section */ 87 | FAB0D57D1BAA624A0095AEDB /* Frameworks */ = { 88 | isa = PBXFrameworksBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | C46A68296567EFB0307B539E /* libPods.a in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | E2D33FCCE277541023D1F17B /* Pods */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 72A69BB41B6702E9A2F9794C /* Pods.debug.xcconfig */, 102 | 3D1551B8ED54951273562DCA /* Pods.release.xcconfig */, 103 | ); 104 | name = Pods; 105 | sourceTree = ""; 106 | }; 107 | FAB0D5771BAA624A0095AEDB = { 108 | isa = PBXGroup; 109 | children = ( 110 | FAB0D5821BAA624A0095AEDB /* AnyChartObjCSample */, 111 | FAB0D5B01BAA62900095AEDB /* Frameworks */, 112 | FAB0D5811BAA624A0095AEDB /* Products */, 113 | E2D33FCCE277541023D1F17B /* Pods */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | FAB0D5811BAA624A0095AEDB /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | FAB0D5801BAA624A0095AEDB /* AnyChartObjCSample.app */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | FAB0D5821BAA624A0095AEDB /* AnyChartObjCSample */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | FAB0D5A91BAA62510095AEDB /* Views */, 129 | FAB0D5AA1BAA625B0095AEDB /* Data */, 130 | FAB0D5871BAA624A0095AEDB /* AppDelegate.h */, 131 | FAB0D5881BAA624A0095AEDB /* AppDelegate.m */, 132 | FAB0D5901BAA624A0095AEDB /* Images.xcassets */, 133 | FAB0D5831BAA624A0095AEDB /* Supporting Files */, 134 | ); 135 | path = AnyChartObjCSample; 136 | sourceTree = ""; 137 | }; 138 | FAB0D5831BAA624A0095AEDB /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | FAB0D5841BAA624A0095AEDB /* Info.plist */, 142 | FAB0D5851BAA624A0095AEDB /* main.m */, 143 | ); 144 | name = "Supporting Files"; 145 | sourceTree = ""; 146 | }; 147 | FAB0D5A91BAA62510095AEDB /* Views */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | FAB6EED61BB8DB2100E5F947 /* Charts */, 151 | FAB6EEE61BB8E14100E5F947 /* iPhone */, 152 | FAB6EEF31BB92A0A00E5F947 /* iPad */, 153 | FAB0D5921BAA624A0095AEDB /* LaunchScreen.xib */, 154 | ); 155 | name = Views; 156 | sourceTree = ""; 157 | }; 158 | FAB0D5AA1BAA625B0095AEDB /* Data */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | FAB0D5B41BAA77DB0095AEDB /* Models */, 162 | FAB0D5AB1BAA626E0095AEDB /* Data.h */, 163 | FAB0D5AC1BAA626E0095AEDB /* Data.m */, 164 | FA01B8D31BAFA78E009510F3 /* Filters.h */, 165 | FA01B8D41BAFA78E009510F3 /* Filters.m */, 166 | ); 167 | name = Data; 168 | sourceTree = ""; 169 | }; 170 | FAB0D5B01BAA62900095AEDB /* Frameworks */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 6A35448378BD88EDD8A3A92B /* libPods.a */, 174 | ); 175 | name = Frameworks; 176 | path = AnyChartObjCSample; 177 | sourceTree = ""; 178 | }; 179 | FAB0D5B41BAA77DB0095AEDB /* Models */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | FAB0D5B11BAA77D60095AEDB /* Product.h */, 183 | FAB0D5B21BAA77D60095AEDB /* Product.m */, 184 | FAB0D5B51BAA781F0095AEDB /* Industry.h */, 185 | FAB0D5B61BAA781F0095AEDB /* Industry.m */, 186 | FAB0D5B81BAA785A0095AEDB /* Region.h */, 187 | FAB0D5B91BAA785A0095AEDB /* Region.m */, 188 | FAB0D5BB1BAA78740095AEDB /* SalesRep.h */, 189 | FAB0D5BC1BAA78740095AEDB /* SalesRep.m */, 190 | FA01B8D61BAFBC7A009510F3 /* IdNameModel.h */, 191 | FA01B8D71BAFBC7A009510F3 /* IdNameModel.m */, 192 | ); 193 | name = Models; 194 | sourceTree = ""; 195 | }; 196 | FAB6EED61BB8DB2100E5F947 /* Charts */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | FA958A4E1BABBAF6005562C9 /* charts.html */, 200 | FAB6EED71BB8DB3800E5F947 /* bar.html */, 201 | FAB6EED91BB8DC6100E5F947 /* column.html */, 202 | FAB6EEDB1BB8DC9600E5F947 /* pie.html */, 203 | FAB6EEDF1BB8DCC200E5F947 /* line.html */, 204 | ); 205 | name = Charts; 206 | sourceTree = ""; 207 | }; 208 | FAB6EEE61BB8E14100E5F947 /* iPhone */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | FAB6EEE11BB8DD4B00E5F947 /* MainIPhone.storyboard */, 212 | FAB6EEE31BB8DDE400E5F947 /* ChartBaseViewController.h */, 213 | FAB6EEE41BB8DDE400E5F947 /* ChartBaseViewController.m */, 214 | FAB6EEE71BB8E1EF00E5F947 /* ByIndustryViewController.h */, 215 | FAB6EEE81BB8E1EF00E5F947 /* ByIndustryViewController.m */, 216 | FAB6EEEA1BB8E2E100E5F947 /* ByProductViewController.h */, 217 | FAB6EEEB1BB8E2E100E5F947 /* ByProductViewController.m */, 218 | FAB6EEED1BB8E33300E5F947 /* BySalesRepViewController.h */, 219 | FAB6EEEE1BB8E33300E5F947 /* BySalesRepViewController.m */, 220 | FAB6EEF01BB8E39500E5F947 /* ByQuarterViewController.h */, 221 | FAB6EEF11BB8E39500E5F947 /* ByQuarterViewController.m */, 222 | FADE042B1BABF1720051DB1E /* FiltersViewController.h */, 223 | FADE042C1BABF1720051DB1E /* FiltersViewController.m */, 224 | ); 225 | name = iPhone; 226 | sourceTree = ""; 227 | }; 228 | FAB6EEF31BB92A0A00E5F947 /* iPad */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | FAB0D58D1BAA624A0095AEDB /* MainIPad.storyboard */, 232 | FAB0D58A1BAA624A0095AEDB /* MainViewController.h */, 233 | FAB0D58B1BAA624A0095AEDB /* MainViewController.m */, 234 | ); 235 | name = iPad; 236 | sourceTree = ""; 237 | }; 238 | /* End PBXGroup section */ 239 | 240 | /* Begin PBXNativeTarget section */ 241 | FAB0D57F1BAA624A0095AEDB /* AnyChartObjCSample */ = { 242 | isa = PBXNativeTarget; 243 | buildConfigurationList = FAB0D5A31BAA624A0095AEDB /* Build configuration list for PBXNativeTarget "AnyChartObjCSample" */; 244 | buildPhases = ( 245 | 38B433D2BE0B52810B8792AD /* Check Pods Manifest.lock */, 246 | FAB0D57C1BAA624A0095AEDB /* Sources */, 247 | FAB0D57D1BAA624A0095AEDB /* Frameworks */, 248 | FAB0D57E1BAA624A0095AEDB /* Resources */, 249 | 1C982083A00EA33B3DB0CDBC /* Copy Pods Resources */, 250 | ); 251 | buildRules = ( 252 | ); 253 | dependencies = ( 254 | ); 255 | name = AnyChartObjCSample; 256 | productName = AnyChartObjCSample; 257 | productReference = FAB0D5801BAA624A0095AEDB /* AnyChartObjCSample.app */; 258 | productType = "com.apple.product-type.application"; 259 | }; 260 | /* End PBXNativeTarget section */ 261 | 262 | /* Begin PBXProject section */ 263 | FAB0D5781BAA624A0095AEDB /* Project object */ = { 264 | isa = PBXProject; 265 | attributes = { 266 | LastUpgradeCheck = 0640; 267 | ORGANIZATIONNAME = AnyChart; 268 | TargetAttributes = { 269 | FAB0D57F1BAA624A0095AEDB = { 270 | CreatedOnToolsVersion = 6.4; 271 | }; 272 | }; 273 | }; 274 | buildConfigurationList = FAB0D57B1BAA624A0095AEDB /* Build configuration list for PBXProject "AnyChartObjCSample" */; 275 | compatibilityVersion = "Xcode 3.2"; 276 | developmentRegion = English; 277 | hasScannedForEncodings = 0; 278 | knownRegions = ( 279 | en, 280 | Base, 281 | ); 282 | mainGroup = FAB0D5771BAA624A0095AEDB; 283 | productRefGroup = FAB0D5811BAA624A0095AEDB /* Products */; 284 | projectDirPath = ""; 285 | projectRoot = ""; 286 | targets = ( 287 | FAB0D57F1BAA624A0095AEDB /* AnyChartObjCSample */, 288 | ); 289 | }; 290 | /* End PBXProject section */ 291 | 292 | /* Begin PBXResourcesBuildPhase section */ 293 | FAB0D57E1BAA624A0095AEDB /* Resources */ = { 294 | isa = PBXResourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | FAB0D58F1BAA624A0095AEDB /* MainIPad.storyboard in Resources */, 298 | FAB0D5941BAA624A0095AEDB /* LaunchScreen.xib in Resources */, 299 | FAB6EEDA1BB8DC6100E5F947 /* column.html in Resources */, 300 | FAB6EED81BB8DB3800E5F947 /* bar.html in Resources */, 301 | FAB6EEE21BB8DD4B00E5F947 /* MainIPhone.storyboard in Resources */, 302 | FAB6EEE01BB8DCC200E5F947 /* line.html in Resources */, 303 | FAB0D5911BAA624A0095AEDB /* Images.xcassets in Resources */, 304 | FAB6EEDC1BB8DC9600E5F947 /* pie.html in Resources */, 305 | FA958A4F1BABBAF6005562C9 /* charts.html in Resources */, 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | }; 309 | /* End PBXResourcesBuildPhase section */ 310 | 311 | /* Begin PBXShellScriptBuildPhase section */ 312 | 1C982083A00EA33B3DB0CDBC /* Copy Pods Resources */ = { 313 | isa = PBXShellScriptBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | ); 317 | inputPaths = ( 318 | ); 319 | name = "Copy Pods Resources"; 320 | outputPaths = ( 321 | ); 322 | runOnlyForDeploymentPostprocessing = 0; 323 | shellPath = /bin/sh; 324 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 325 | showEnvVarsInLog = 0; 326 | }; 327 | 38B433D2BE0B52810B8792AD /* Check Pods Manifest.lock */ = { 328 | isa = PBXShellScriptBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | ); 332 | inputPaths = ( 333 | ); 334 | name = "Check Pods Manifest.lock"; 335 | outputPaths = ( 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | shellPath = /bin/sh; 339 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 340 | showEnvVarsInLog = 0; 341 | }; 342 | /* End PBXShellScriptBuildPhase section */ 343 | 344 | /* Begin PBXSourcesBuildPhase section */ 345 | FAB0D57C1BAA624A0095AEDB /* Sources */ = { 346 | isa = PBXSourcesBuildPhase; 347 | buildActionMask = 2147483647; 348 | files = ( 349 | FAB6EEE91BB8E1EF00E5F947 /* ByIndustryViewController.m in Sources */, 350 | FAB0D5BA1BAA785A0095AEDB /* Region.m in Sources */, 351 | FAB6EEF21BB8E39500E5F947 /* ByQuarterViewController.m in Sources */, 352 | FA01B8D81BAFBC7A009510F3 /* IdNameModel.m in Sources */, 353 | FAB0D58C1BAA624A0095AEDB /* MainViewController.m in Sources */, 354 | FAB6EEEF1BB8E33300E5F947 /* BySalesRepViewController.m in Sources */, 355 | FAB0D5B71BAA781F0095AEDB /* Industry.m in Sources */, 356 | FAB6EEE51BB8DDE400E5F947 /* ChartBaseViewController.m in Sources */, 357 | FA01B8D51BAFA78E009510F3 /* Filters.m in Sources */, 358 | FAB0D5B31BAA77D60095AEDB /* Product.m in Sources */, 359 | FAB0D5BD1BAA78740095AEDB /* SalesRep.m in Sources */, 360 | FAB0D5891BAA624A0095AEDB /* AppDelegate.m in Sources */, 361 | FADE042D1BABF1720051DB1E /* FiltersViewController.m in Sources */, 362 | FAB0D5861BAA624A0095AEDB /* main.m in Sources */, 363 | FAB0D5AD1BAA626E0095AEDB /* Data.m in Sources */, 364 | FAB6EEEC1BB8E2E100E5F947 /* ByProductViewController.m in Sources */, 365 | ); 366 | runOnlyForDeploymentPostprocessing = 0; 367 | }; 368 | /* End PBXSourcesBuildPhase section */ 369 | 370 | /* Begin PBXVariantGroup section */ 371 | FAB0D58D1BAA624A0095AEDB /* MainIPad.storyboard */ = { 372 | isa = PBXVariantGroup; 373 | children = ( 374 | FAB0D58E1BAA624A0095AEDB /* Base */, 375 | ); 376 | name = MainIPad.storyboard; 377 | sourceTree = ""; 378 | }; 379 | FAB0D5921BAA624A0095AEDB /* LaunchScreen.xib */ = { 380 | isa = PBXVariantGroup; 381 | children = ( 382 | FAB0D5931BAA624A0095AEDB /* Base */, 383 | ); 384 | name = LaunchScreen.xib; 385 | sourceTree = ""; 386 | }; 387 | /* End PBXVariantGroup section */ 388 | 389 | /* Begin XCBuildConfiguration section */ 390 | FAB0D5A11BAA624A0095AEDB /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ALWAYS_SEARCH_USER_PATHS = NO; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INT_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_UNREACHABLE_CODE = YES; 406 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 407 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 408 | COPY_PHASE_STRIP = NO; 409 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 410 | ENABLE_STRICT_OBJC_MSGSEND = YES; 411 | GCC_C_LANGUAGE_STANDARD = gnu99; 412 | GCC_DYNAMIC_NO_PIC = NO; 413 | GCC_NO_COMMON_BLOCKS = YES; 414 | GCC_OPTIMIZATION_LEVEL = 0; 415 | GCC_PREPROCESSOR_DEFINITIONS = ( 416 | "DEBUG=1", 417 | "$(inherited)", 418 | ); 419 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 427 | MTL_ENABLE_DEBUG_INFO = YES; 428 | ONLY_ACTIVE_ARCH = YES; 429 | SDKROOT = iphoneos; 430 | TARGETED_DEVICE_FAMILY = "1,2"; 431 | }; 432 | name = Debug; 433 | }; 434 | FAB0D5A21BAA624A0095AEDB /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ALWAYS_SEARCH_USER_PATHS = NO; 438 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 439 | CLANG_CXX_LIBRARY = "libc++"; 440 | CLANG_ENABLE_MODULES = YES; 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CLANG_WARN_BOOL_CONVERSION = YES; 443 | CLANG_WARN_CONSTANT_CONVERSION = YES; 444 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 445 | CLANG_WARN_EMPTY_BODY = YES; 446 | CLANG_WARN_ENUM_CONVERSION = YES; 447 | CLANG_WARN_INT_CONVERSION = YES; 448 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 449 | CLANG_WARN_UNREACHABLE_CODE = YES; 450 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 452 | COPY_PHASE_STRIP = NO; 453 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 454 | ENABLE_NS_ASSERTIONS = NO; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | GCC_C_LANGUAGE_STANDARD = gnu99; 457 | GCC_NO_COMMON_BLOCKS = YES; 458 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 459 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 460 | GCC_WARN_UNDECLARED_SELECTOR = YES; 461 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 462 | GCC_WARN_UNUSED_FUNCTION = YES; 463 | GCC_WARN_UNUSED_VARIABLE = YES; 464 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 465 | MTL_ENABLE_DEBUG_INFO = NO; 466 | SDKROOT = iphoneos; 467 | TARGETED_DEVICE_FAMILY = "1,2"; 468 | VALIDATE_PRODUCT = YES; 469 | }; 470 | name = Release; 471 | }; 472 | FAB0D5A41BAA624A0095AEDB /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | baseConfigurationReference = 72A69BB41B6702E9A2F9794C /* Pods.debug.xcconfig */; 475 | buildSettings = { 476 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 477 | INFOPLIST_FILE = AnyChartObjCSample/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | }; 481 | name = Debug; 482 | }; 483 | FAB0D5A51BAA624A0095AEDB /* Release */ = { 484 | isa = XCBuildConfiguration; 485 | baseConfigurationReference = 3D1551B8ED54951273562DCA /* Pods.release.xcconfig */; 486 | buildSettings = { 487 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 488 | INFOPLIST_FILE = AnyChartObjCSample/Info.plist; 489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 490 | PRODUCT_NAME = "$(TARGET_NAME)"; 491 | }; 492 | name = Release; 493 | }; 494 | /* End XCBuildConfiguration section */ 495 | 496 | /* Begin XCConfigurationList section */ 497 | FAB0D57B1BAA624A0095AEDB /* Build configuration list for PBXProject "AnyChartObjCSample" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | FAB0D5A11BAA624A0095AEDB /* Debug */, 501 | FAB0D5A21BAA624A0095AEDB /* Release */, 502 | ); 503 | defaultConfigurationIsVisible = 0; 504 | defaultConfigurationName = Release; 505 | }; 506 | FAB0D5A31BAA624A0095AEDB /* Build configuration list for PBXNativeTarget "AnyChartObjCSample" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | FAB0D5A41BAA624A0095AEDB /* Debug */, 510 | FAB0D5A51BAA624A0095AEDB /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = FAB0D5781BAA624A0095AEDB /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /AnyChartObjCSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AnyChartObjCSample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /AnyChartObjCSample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "Data.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Base.lproj/MainIPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 49 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ByIndustryViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ByIndustryViewController.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ChartBaseViewController.h" 10 | 11 | @interface ByIndustryViewController : ChartBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ByIndustryViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ByIndustryViewController.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ByIndustryViewController.h" 10 | #import "Data.h" 11 | #import "Filters.h" 12 | 13 | @implementation ByIndustryViewController 14 | 15 | - (NSString*)htmlFileName { 16 | return @"bar"; 17 | } 18 | 19 | - (id)chartData { 20 | return [[Data shared] revenueByIndustryInYear:[Filters year] 21 | inQuarter:[Filters quarter] 22 | forProduct:[Filters productId] 23 | inRegion:[Filters regionId] 24 | forIndustry:[Filters industryId] 25 | salesRep:[Filters salesRepId]]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ByProductViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ByProductViewController.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ChartBaseViewController.h" 10 | 11 | @interface ByProductViewController : ChartBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ByProductViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ByProductViewController.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ByProductViewController.h" 10 | #import "Data.h" 11 | #import "Filters.h" 12 | 13 | @implementation ByProductViewController 14 | 15 | - (NSString*)htmlFileName { 16 | return @"pie"; 17 | } 18 | 19 | - (id)chartData { 20 | return [[Data shared] revenueByProductInYear:[Filters year] 21 | inQuarter:[Filters quarter] 22 | forProduct:[Filters productId] 23 | inRegion:[Filters regionId] 24 | forIndustry:[Filters industryId] 25 | salesRep:[Filters salesRepId]]; 26 | } 27 | 28 | @end -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ByQuarterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ByQuarterViewController.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ChartBaseViewController.h" 10 | 11 | @interface ByQuarterViewController : ChartBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ByQuarterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ByQuarterViewController.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ByQuarterViewController.h" 10 | #import "Data.h" 11 | #import "Filters.h" 12 | 13 | @implementation ByQuarterViewController 14 | 15 | - (NSString*)htmlFileName { 16 | return @"line"; 17 | } 18 | 19 | - (id)chartData { 20 | return [[Data shared] revenueByQuarterInYear:[Filters year] 21 | inQuarter:[Filters quarter] 22 | forProduct:[Filters productId] 23 | inRegion:[Filters regionId] 24 | forIndustry:[Filters industryId] 25 | salesRep:[Filters salesRepId]]; 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/BySalesRepViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BySalesRepViewController.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ChartBaseViewController.h" 10 | 11 | @interface BySalesRepViewController : ChartBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/BySalesRepViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ByProductViewController.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "BySalesRepViewController.h" 10 | #import "Data.h" 11 | #import "Filters.h" 12 | 13 | @implementation BySalesRepViewController 14 | 15 | - (NSString*)htmlFileName { 16 | return @"column"; 17 | } 18 | 19 | - (id)chartData { 20 | return [[Data shared] revenueBySalesRepInYear:[Filters year] 21 | inQuarter:[Filters quarter] 22 | forProduct:[Filters productId] 23 | inRegion:[Filters regionId] 24 | forIndustry:[Filters industryId] 25 | salesRep:[Filters salesRepId]]; 26 | } 27 | 28 | @end -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ChartBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChartBaseViewController.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ChartBaseViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UIWebView *webView; 14 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicatorView; 15 | 16 | - (NSString*)htmlFileName; 17 | - (id)chartData; 18 | 19 | @end -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/ChartBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChartBaseViewController.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/28/15. 6 | // Copyright © 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "ChartBaseViewController.h" 10 | 11 | @interface ChartBaseViewController () { 12 | BOOL firstRenderCompleted; 13 | } 14 | 15 | @end 16 | 17 | @implementation ChartBaseViewController 18 | 19 | - (NSString*)htmlFileName { return nil; } 20 | - (id)chartData { return nil; } 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | firstRenderCompleted = NO; 26 | 27 | [self.webView loadRequest: 28 | [NSURLRequest requestWithURL: 29 | [NSURL fileURLWithPath: 30 | [[NSBundle mainBundle] pathForResource:self.htmlFileName ofType:@"html"] isDirectory:NO]]]; 31 | } 32 | 33 | - (void)webViewDidFinishLoad:(UIWebView *)webView { 34 | if (!webView.loading && !firstRenderCompleted) { 35 | [self updateChart]; 36 | } 37 | } 38 | 39 | - (void)viewWillAppear:(BOOL)animated { 40 | [super viewWillAppear:animated]; 41 | [self.navigationController setNavigationBarHidden:YES animated:animated]; 42 | if (firstRenderCompleted) { 43 | [self.webView stringByEvaluatingJavaScriptFromString:@"clear();"]; 44 | [self.activityIndicatorView startAnimating]; 45 | } 46 | } 47 | 48 | - (void)viewDidAppear:(BOOL)animated { 49 | [super viewDidAppear:animated]; 50 | if (firstRenderCompleted) { 51 | [self updateChart]; 52 | } 53 | } 54 | 55 | - (void)updateChart { 56 | NSError* error; 57 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self.chartData options:NSJSONWritingPrettyPrinted error:&error]; 58 | if (error) { 59 | NSLog(@"JSON generation failed: %@", error); 60 | }else { 61 | NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 62 | [self.webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"showChart(%@)", jsonString]]; 63 | } 64 | 65 | firstRenderCompleted = YES; 66 | [self.activityIndicatorView stopAnimating]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Data.h: -------------------------------------------------------------------------------- 1 | // 2 | // Data.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Product.h" 11 | #import "Industry.h" 12 | #import "Region.h" 13 | #import "SalesRep.h" 14 | 15 | @interface Data : NSObject 16 | 17 | + (Data*)shared; 18 | 19 | - (NSArray*)years; 20 | - (NSArray*)products; 21 | - (Product*)productById:(NSNumber*)productId; 22 | - (NSArray*)industries; 23 | - (Industry*)industryById:(NSNumber*)industryId; 24 | - (NSArray*)regions; 25 | - (Region*)regionById:(NSNumber*)regionId; 26 | - (NSArray*)salesReps; 27 | - (SalesRep*)salesRepById:(NSNumber*)salesRepId; 28 | 29 | - (NSArray*)revenueByIndustryInYear:(NSNumber*)year 30 | inQuarter:(NSNumber*)quarter 31 | forProduct:(NSNumber*)product 32 | inRegion:(NSNumber*)region 33 | forIndustry:(NSNumber*)industry 34 | salesRep:(NSNumber*)salesRep; 35 | 36 | - (NSArray*)revenueBySalesRepInYear:(NSNumber*)year 37 | inQuarter:(NSNumber*)quarter 38 | forProduct:(NSNumber*)product 39 | inRegion:(NSNumber*)region 40 | forIndustry:(NSNumber*)industry 41 | salesRep:(NSNumber*)salesRep; 42 | 43 | - (NSArray*)revenueByProductInYear:(NSNumber*)year 44 | inQuarter:(NSNumber*)quarter 45 | forProduct:(NSNumber*)product 46 | inRegion:(NSNumber*)region 47 | forIndustry:(NSNumber*)industry 48 | salesRep:(NSNumber*)salesRep; 49 | 50 | - (NSArray*)revenueByQuarterInYear:(NSNumber*)year 51 | inQuarter:(NSNumber*)quarter 52 | forProduct:(NSNumber*)product 53 | inRegion:(NSNumber*)region 54 | forIndustry:(NSNumber*)industry 55 | salesRep:(NSNumber*)salesRep; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Data.m: -------------------------------------------------------------------------------- 1 | // 2 | // Data.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "Data.h" 10 | #import 11 | 12 | @interface Data() 13 | 14 | @property FMDatabase *db; 15 | 16 | @end 17 | 18 | @implementation Data 19 | 20 | + (BOOL)addSkipBackupAttributeToItemAtPath:(NSString *) filePathString 21 | { 22 | NSURL* URL= [NSURL fileURLWithPath: filePathString]; 23 | BOOL success; 24 | if ([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]) { 25 | 26 | NSError *error = nil; 27 | success = [URL setResourceValue: [NSNumber numberWithBool: YES] 28 | forKey: NSURLIsExcludedFromBackupKey error: &error]; 29 | if(!success){ 30 | NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error); 31 | } 32 | } 33 | return success; 34 | } 35 | 36 | - (NSString*)databasePath { 37 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 38 | NSString *documentsDirectory = [paths objectAtIndex:0]; 39 | NSString *databasePath = [documentsDirectory stringByAppendingPathComponent:@"data.sqlite3"]; 40 | return databasePath; 41 | } 42 | 43 | + (Data*)shared { 44 | static Data *sharedData = nil; 45 | static dispatch_once_t onceToken; 46 | dispatch_once(&onceToken, ^{ 47 | sharedData = [[self alloc] init]; 48 | }); 49 | return sharedData; 50 | } 51 | 52 | - (id)init { 53 | self = [super init]; 54 | if (self) { 55 | [Data addSkipBackupAttributeToItemAtPath:self.databasePath]; 56 | self.db = [FMDatabase databaseWithPath:self.databasePath]; 57 | if (![self.db open]) { 58 | NSLog(@"Failed to open databse"); 59 | }else { 60 | [self setup]; 61 | } 62 | } 63 | return self; 64 | } 65 | 66 | + (NSDate*)dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day { 67 | NSCalendar *calendar = [NSCalendar currentCalendar]; 68 | NSDateComponents *components = [[NSDateComponents alloc] init]; 69 | [components setYear:year]; 70 | [components setMonth:month]; 71 | [components setDay:day]; 72 | return [calendar dateFromComponents:components]; 73 | } 74 | 75 | - (int)getQuarter:(NSInteger)month { 76 | //known ios issue, NSCalendarUnitQuarter not working 77 | if (month < 4) return 0; 78 | if (month < 7) return 1; 79 | if (month < 10) return 2; 80 | return 3; 81 | } 82 | 83 | - (void)setup { 84 | if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"db_version"] isEqualToString:@"1.0"]) 85 | return; 86 | 87 | [self.db executeStatements:@"DROP TABLE IF EXISTS industry;" 88 | "DROP TABLE IF EXISTS product;" 89 | "DROP TABLE IF EXISTS region;" 90 | "DROP TABLE IF EXISTS sales_reps;" 91 | "DROP TABLE IF EXISTS sales;"]; 92 | 93 | [self.db executeStatements:@"CREATE TABLE industry (id INTEGER PRIMARY KEY, name TEXT);" 94 | "CREATE TABLE product (id INTEGER PRIMARY KEY, industry_id INTEGER, name TEXT);" 95 | "CREATE TABLE region (id INTEGER PRIMARY KEY, name TEXT);" 96 | "CREATE TABLE sales_reps (id INTEGER PRIMARY KEY, name TEXT);" 97 | "CREATE TABLE sales (date TEXT, quarter INTEGER, product_id INTEGER, region_id INTEGER, rep_id INTEGER, total REAL)"]; 98 | 99 | [self.db executeStatements:@"INSERT INTO industry (id, name) VALUES (0, 'Materials');" 100 | "INSERT INTO industry (id, name) VALUES (1, 'Consumer Goods');" 101 | "INSERT INTO industry (id, name) VALUES (2, 'Finance');" 102 | "INSERT INTO industry (id, name) VALUES (3, 'Healthcare');"]; 103 | 104 | [self.db executeStatements:@"INSERT INTO product (id, industry_id, name) VALUES (0, 0, 'Product 1');" 105 | "INSERT INTO product (id, industry_id, name) VALUES (1, 1, 'Product 2');" 106 | "INSERT INTO product (id, industry_id, name) VALUES (2, 2, 'Product 3');" 107 | "INSERT INTO product (id, industry_id, name) VALUES (3, 2, 'Product 4');" 108 | "INSERT INTO product (id, industry_id, name) VALUES (4, 3, 'Product 5');"]; 109 | 110 | [self.db executeStatements:@"INSERT INTO region (id, name) VALUES (0, 'North America');" 111 | "INSERT INTO region (id, name) VALUES (1, 'Latin America');" 112 | "INSERT INTO region (id, name) VALUES (2, 'Europe');" 113 | "INSERT INTO region (id, name) VALUES (3, 'Middle East');" 114 | "INSERT INTO region (id, name) VALUES (4, 'Asia Pacific');"]; 115 | 116 | [self.db executeStatements:@"INSERT INTO sales_reps (id, name) VALUES (0, 'Paul Smith');" 117 | "INSERT INTO sales_reps (id, name) VALUES (1, 'Joe Hernandez');" 118 | "INSERT INTO sales_reps (id, name) VALUES (2, 'Heidi Weild');" 119 | "INSERT INTO sales_reps (id, name) VALUES (3, 'Roberto Pallino');" 120 | "INSERT INTO sales_reps (id, name) VALUES (4, 'Amir Kutra');"]; 121 | 122 | [self.db beginTransaction]; 123 | 124 | NSDate *startDate = [Data dateWithYear:2005 month:1 day:1]; 125 | NSDate *endDate = [Data dateWithYear:2015 month:12 day:1]; 126 | NSTimeInterval dateRange = [endDate timeIntervalSinceDate:startDate]; 127 | 128 | NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; 129 | [dateFormat setDateFormat:@"yyyy-MM-dd"]; 130 | 131 | NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 132 | 133 | for (int i = 0; i < 100000; i++) { 134 | NSTimeInterval randomInterval = arc4random_uniform(dateRange); 135 | NSDate *date = [startDate dateByAddingTimeInterval:randomInterval]; 136 | 137 | int quarter = [self getQuarter:[gregorian component:NSCalendarUnitMonth fromDate:date]]; 138 | 139 | [self.db executeUpdate:@"INSERT INTO sales (date, quarter, product_id, region_id, rep_id, total) VALUES (?, ?, ?, ?, ?, ?);" 140 | , [dateFormat stringFromDate:date], [NSNumber numberWithInt:quarter], [NSNumber numberWithInt:arc4random_uniform(5)] 141 | , [NSNumber numberWithInt:arc4random_uniform(5)], [NSNumber numberWithInt:arc4random_uniform(5)], [NSNumber numberWithDouble:100 + arc4random_uniform(900)]]; 142 | } 143 | [self.db commit]; 144 | 145 | [[NSUserDefaults standardUserDefaults] setObject:@"1.0" forKey:@"db_version"]; 146 | [[NSUserDefaults standardUserDefaults] synchronize]; 147 | } 148 | 149 | - (NSArray*)years { 150 | NSMutableArray *years = [[NSMutableArray alloc] init]; 151 | 152 | FMResultSet *s = [self.db executeQuery:@"SELECT strftime('%Y', date) AS year FROM sales GROUP BY 1;"]; 153 | while ([s next]) { 154 | [years addObject:[NSNumber numberWithInt:[s intForColumnIndex:0]]]; 155 | } 156 | return years; 157 | } 158 | 159 | - (NSArray*)products { 160 | NSMutableArray *products = [[NSMutableArray alloc] init]; 161 | 162 | FMResultSet *s = [self.db executeQuery:@"SELECT id, industry_id, name FROM product ORDER BY name;"]; 163 | while ([s next]) { 164 | [products addObject:[Product productWithId:[s intForColumnIndex:0] 165 | industry:[s intForColumnIndex:1] 166 | name:[s stringForColumnIndex:2]]]; 167 | } 168 | 169 | return products; 170 | } 171 | 172 | - (Product*)productById:(NSNumber *)productId { 173 | FMResultSet *s = [self.db executeQuery:@"SELECT id, industry_id, name FROM product WHERE id=?" withArgumentsInArray:@[productId]]; 174 | if (![s next]) return nil; 175 | return [Product productWithId:[s intForColumnIndex:0] 176 | industry:[s intForColumnIndex:1] 177 | name:[s stringForColumnIndex:2]]; 178 | } 179 | 180 | - (NSArray*)industries { 181 | NSMutableArray *industries = [[NSMutableArray alloc] init]; 182 | 183 | FMResultSet *s = [self.db executeQuery:@"SELECT id, name FROM industry ORDER BY name;"]; 184 | while ([s next]) { 185 | [industries addObject:[Industry industryWithId:[s intForColumnIndex:0] 186 | name:[s stringForColumnIndex:1]]]; 187 | } 188 | return industries; 189 | } 190 | 191 | - (Industry*)industryById:(NSNumber *)industryId { 192 | FMResultSet *s = [self.db executeQuery:@"SELECT id, name FROM industry WHERE id=?" withArgumentsInArray:@[industryId]]; 193 | if (![s next]) return nil; 194 | return [Industry industryWithId:[s intForColumnIndex:0] 195 | name:[s stringForColumnIndex:1]]; 196 | } 197 | 198 | - (NSArray*)regions { 199 | NSMutableArray *regions = [[NSMutableArray alloc] init]; 200 | 201 | FMResultSet *s = [self.db executeQuery:@"SELECT id, name FROM region ORDER BY name;"]; 202 | while ([s next]) { 203 | [regions addObject:[Region regionWithId:[s intForColumnIndex:0] 204 | name:[s stringForColumnIndex:1]]]; 205 | } 206 | return regions; 207 | } 208 | 209 | - (Region*)regionById:(NSNumber *)regionId { 210 | FMResultSet *s = [self.db executeQuery:@"SELECT id, name FROM region WHERE id=?" withArgumentsInArray:@[regionId]]; 211 | if (![s next]) return nil; 212 | return [Region regionWithId:[s intForColumnIndex:0] 213 | name:[s stringForColumnIndex:1]]; 214 | } 215 | 216 | - (NSArray*)salesReps { 217 | NSMutableArray *salesReps = [[NSMutableArray alloc] init]; 218 | 219 | FMResultSet *s = [self.db executeQuery:@"SELECT id, name FROM sales_reps ORDER BY name;"]; 220 | while ([s next]) { 221 | [salesReps addObject:[SalesRep salesRepWithId:[s intForColumnIndex:0] 222 | name:[s stringForColumnIndex:1]]]; 223 | } 224 | return salesReps; 225 | } 226 | 227 | - (SalesRep*)salesRepById:(NSNumber *)salesRepId { 228 | FMResultSet *s = [self.db executeQuery:@"SELECT id, name FROM sales_reps WHERE id=?" withArgumentsInArray:@[salesRepId]]; 229 | if (![s next]) return nil; 230 | return [SalesRep salesRepWithId:[s intForColumnIndex:0] 231 | name:[s stringForColumnIndex:1]]; 232 | } 233 | 234 | - (void)addFilters:(NSMutableString*)query params:(NSMutableDictionary*)params 235 | year:(NSNumber*)year 236 | quarter:(NSNumber*)quarter 237 | product:(NSNumber*)product 238 | region:(NSNumber*)region 239 | industry:(NSNumber*)industry 240 | salesRep:(NSNumber*)salesRep { 241 | 242 | if (year) { 243 | [query appendString:@" AND strftime('%Y', sales.date)=:year"]; 244 | [params setObject:[year stringValue] forKey:@"year"]; 245 | } 246 | 247 | if (quarter) { 248 | [query appendString:@" AND sales.quarter=:quarter"]; 249 | [params setObject:quarter forKey:@"quarter"]; 250 | } 251 | 252 | if (product) { 253 | [query appendString:@" AND sales.product_id=:product"]; 254 | [params setObject:product forKey:@"product"]; 255 | } 256 | 257 | if (region) { 258 | [query appendString:@" AND sales.region_id=:region"]; 259 | [params setObject:region forKey:@"region"]; 260 | } 261 | 262 | if (industry) { 263 | [query appendString:@" AND product.industry_id=:industry AND industry.id=:industry"]; 264 | [params setObject:industry forKey:@"industry"]; 265 | } 266 | 267 | if (salesRep) { 268 | [query appendString:@" AND sales.rep_id=:sales_rep"]; 269 | [params setObject:salesRep forKey:@"sales_rep"]; 270 | } 271 | } 272 | 273 | - (NSArray*)revenueByIndustryInYear:(NSNumber*)year 274 | inQuarter:(NSNumber*)quarter 275 | forProduct:(NSNumber*)product 276 | inRegion:(NSNumber*)region 277 | forIndustry:(NSNumber*)industry 278 | salesRep:(NSNumber*)salesRep { 279 | 280 | NSMutableArray *res = [[NSMutableArray alloc] init]; 281 | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; 282 | NSMutableString *query = [[NSMutableString alloc] 283 | initWithString:@"SELECT industry.name AS name, SUM(sales.total) AS revenue " 284 | "FROM industry, sales, product " 285 | "WHERE sales.product_id = product.id"]; 286 | [self addFilters:query params:params year:year quarter:quarter product:product region:region industry:industry salesRep:salesRep]; 287 | 288 | [query appendString:@" GROUP BY industry.id ORDER BY 1"]; 289 | 290 | FMResultSet *s = [self.db executeQuery: query withParameterDictionary:params]; 291 | while ([s next]) { 292 | [res addObject:@[[s stringForColumn:@"name"], 293 | [NSNumber numberWithDouble:[s doubleForColumn:@"revenue"]]]]; 294 | } 295 | return res; 296 | } 297 | 298 | - (NSArray*)revenueBySalesRepInYear:(NSNumber *)year 299 | inQuarter:(NSNumber *)quarter 300 | forProduct:(NSNumber *)product 301 | inRegion:(NSNumber *)region 302 | forIndustry:(NSNumber *)industry 303 | salesRep:(NSNumber *)salesRep { 304 | NSMutableArray *res = [[NSMutableArray alloc] init]; 305 | 306 | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; 307 | NSMutableString *query = [[NSMutableString alloc] 308 | initWithString:@"SELECT sales_reps.name AS name, SUM(sales.total) AS revenue " 309 | "FROM industry, sales, sales_reps, product " 310 | "WHERE sales_reps.id = sales.rep_id"]; 311 | [self addFilters:query params:params year:year quarter:quarter product:product region:region industry:industry salesRep:salesRep]; 312 | [query appendString:@" GROUP BY sales_reps.id ORDER BY 1"]; 313 | 314 | FMResultSet *s = [self.db executeQuery: query withParameterDictionary:params]; 315 | while ([s next]) { 316 | [res addObject:@[[s stringForColumn:@"name"], 317 | [NSNumber numberWithDouble:[s doubleForColumn:@"revenue"]]]]; 318 | } 319 | return res; 320 | } 321 | 322 | - (NSArray*)revenueByProductInYear:(NSNumber*)year 323 | inQuarter:(NSNumber*)quarter 324 | forProduct:(NSNumber*)product 325 | inRegion:(NSNumber*)region 326 | forIndustry:(NSNumber*)industry 327 | salesRep:(NSNumber*)salesRep { 328 | 329 | NSMutableArray *res = [[NSMutableArray alloc] init]; 330 | 331 | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; 332 | NSMutableString *query = [[NSMutableString alloc] 333 | initWithString:@"SELECT product.name AS name, SUM(sales.total) AS revenue " 334 | "FROM industry, sales, product " 335 | "WHERE sales.product_id = product.id"]; 336 | [self addFilters:query params:params year:year quarter:quarter product:product region:region industry:industry salesRep:salesRep]; 337 | [query appendString:@" GROUP BY product.id ORDER BY 1"]; 338 | 339 | FMResultSet *s = [self.db executeQuery: query withParameterDictionary:params]; 340 | while ([s next]) { 341 | [res addObject:@[[s stringForColumn:@"name"], 342 | [NSNumber numberWithDouble:[s doubleForColumn:@"revenue"]]]]; 343 | } 344 | return res; 345 | } 346 | 347 | - (NSArray*)revenueByQuarterInYear:(NSNumber*)year 348 | inQuarter:(NSNumber*)quarter 349 | forProduct:(NSNumber*)product 350 | inRegion:(NSNumber*)region 351 | forIndustry:(NSNumber*)industry 352 | salesRep:(NSNumber*)salesRep { 353 | NSMutableArray *res = [[NSMutableArray alloc] init]; 354 | 355 | NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; 356 | NSMutableString *query = [[NSMutableString alloc] 357 | initWithString:@"SELECT strftime('%Y', sales.date) AS year, "]; 358 | if (quarter) { 359 | [query appendString:@"SUM(sales.total) AS revenue "]; 360 | }else { 361 | [query appendString:@"SUM(CASE WHEN sales.quarter=0 THEN sales.total ELSE 0 END) AS q1, " 362 | "SUM(CASE WHEN sales.quarter=1 THEN sales.total ELSE 0 END) AS q2, " 363 | "SUM(CASE WHEN sales.quarter=2 THEN sales.total ELSE 0 END) AS q3, " 364 | "SUM(CASE WHEN sales.quarter=3 THEN sales.total ELSE 0 END) AS q4 "]; 365 | } 366 | [query appendString:@"FROM industry, sales, product WHERE 1"]; 367 | [self addFilters:query params:params year:year quarter:quarter product:product region:region industry:industry salesRep:salesRep]; 368 | [query appendString:@" GROUP BY 1 ORDER BY 1"]; 369 | 370 | FMResultSet *s = [self.db executeQuery: query withParameterDictionary:params]; 371 | while ([s next]) { 372 | if (quarter) 373 | [res addObject:@[[NSNumber numberWithInt:[s intForColumn:@"year"]], 374 | [NSNumber numberWithDouble:[s doubleForColumn:@"revenue"]]]]; 375 | else 376 | [res addObject:@[[NSNumber numberWithInt:[s intForColumn:@"year"]], 377 | [NSNumber numberWithDouble:[s doubleForColumn:@"q1"]], 378 | [NSNumber numberWithDouble:[s doubleForColumn:@"q2"]], 379 | [NSNumber numberWithDouble:[s doubleForColumn:@"q3"]], 380 | [NSNumber numberWithDouble:[s doubleForColumn:@"q4"]]]]; 381 | } 382 | return res; 383 | } 384 | 385 | - (void)dealloc { 386 | [self.db close]; 387 | } 388 | 389 | @end 390 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Filters.h: -------------------------------------------------------------------------------- 1 | // 2 | // Filters.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/21/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, FilterKey) { 12 | FilterKeyYear = 0, 13 | FilterKeyQuarter, 14 | FilterKeyProductId, 15 | FilterKeyRegionId, 16 | FilterKeySalesRepId, 17 | FilterKeyIndustryId 18 | }; 19 | 20 | @interface Filters : NSObject 21 | 22 | + (NSNumber*)year; 23 | + (NSNumber*)quarter; 24 | + (NSNumber*)productId; 25 | + (NSNumber*)regionId; 26 | + (NSNumber*)salesRepId; 27 | + (NSNumber*)industryId; 28 | 29 | + (void)setFilterValue:(NSNumber*)value forKey:(FilterKey)key; 30 | + (NSNumber*)filterValueForKey:(FilterKey)key; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Filters.m: -------------------------------------------------------------------------------- 1 | // 2 | // Filters.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/21/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "Filters.h" 10 | 11 | @implementation Filters 12 | 13 | + (void)setFilterValue:(NSNumber*)value forKey:(FilterKey)key { 14 | [[NSUserDefaults standardUserDefaults] setObject:value forKey:@(key).stringValue]; 15 | [[NSUserDefaults standardUserDefaults] synchronize]; 16 | } 17 | 18 | + (NSNumber*)filterValueForKey:(FilterKey)key { 19 | return [[NSUserDefaults standardUserDefaults] objectForKey:@(key).stringValue]; 20 | } 21 | 22 | + (NSNumber*)year { 23 | return [self filterValueForKey:FilterKeyYear]; 24 | } 25 | 26 | + (NSNumber*)quarter { 27 | return [self filterValueForKey:FilterKeyQuarter]; 28 | } 29 | 30 | + (NSNumber*)productId { 31 | return [self filterValueForKey:FilterKeyProductId]; 32 | } 33 | 34 | + (NSNumber*)regionId { 35 | return [self filterValueForKey:FilterKeyRegionId]; 36 | } 37 | 38 | + (NSNumber*)salesRepId { 39 | return [self filterValueForKey:FilterKeySalesRepId]; 40 | } 41 | 42 | + (NSNumber*)industryId { 43 | return [self filterValueForKey:FilterKeyIndustryId]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/FiltersViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FiltersViewController.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/18/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FiltersViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/FiltersViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FiltersViewController.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/18/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "FiltersViewController.h" 10 | #import "Filters.h" 11 | #import "Data.h" 12 | 13 | @interface FiltersViewController () 14 | 15 | @property (strong, nonatomic) UIPickerView *pickerView; 16 | @property (strong, nonatomic) UIView *overlayView; 17 | @property (weak, nonatomic) IBOutlet UIButton *yearsButton; 18 | @property (weak, nonatomic) IBOutlet UIButton *quartersButton; 19 | @property (weak, nonatomic) IBOutlet UIButton *industryButton; 20 | @property (weak, nonatomic) IBOutlet UIButton *regionButton; 21 | @property (weak, nonatomic) IBOutlet UIButton *productButton; 22 | @property (weak, nonatomic) IBOutlet UIButton *salesRepButton; 23 | 24 | @property NSArray* currentFilterItems; 25 | @property NSNumber* selectedFitlerItem; 26 | @property FilterKey currentFilterKey; 27 | 28 | @end 29 | 30 | @implementation FiltersViewController 31 | 32 | - (void)viewDidLoad { 33 | [super viewDidLoad]; 34 | self.pickerView = [[UIPickerView alloc] init]; 35 | self.pickerView.dataSource = self; 36 | self.pickerView.delegate = self; 37 | self.pickerView.backgroundColor = [UIColor whiteColor]; 38 | [self updateFilters]; 39 | 40 | self.overlayView = [[UIView alloc] init]; 41 | self.overlayView.backgroundColor = [UIColor colorWithRed:0.6f green:0.6f blue:0.6f alpha:0.3f]; 42 | 43 | [self.overlayView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self 44 | action:@selector(hideFilter:)]]; 45 | } 46 | 47 | - (void)viewWillAppear:(BOOL)animated { 48 | [super viewWillAppear:animated]; 49 | [self.navigationController setNavigationBarHidden:NO animated:animated]; 50 | } 51 | 52 | - (void)updateFilters { 53 | [self.yearsButton setTitle:([Filters year] == nil ? @"All" : [[Filters year] stringValue]) 54 | forState:UIControlStateNormal]; 55 | 56 | [self.quartersButton setTitle:([Filters quarter] == nil ? @"All" : [[Filters quarter] stringValue]) 57 | forState:UIControlStateNormal]; 58 | 59 | if ([Filters industryId] == nil) { 60 | [self.industryButton setTitle:@"All" forState:UIControlStateNormal]; 61 | }else { 62 | Industry *val = [[Data shared] industryById:[Filters industryId]]; 63 | [self.industryButton setTitle:val.name forState:UIControlStateNormal]; 64 | } 65 | 66 | if ([Filters regionId] == nil) { 67 | [self.regionButton setTitle:@"All" forState:UIControlStateNormal]; 68 | }else { 69 | Region *val = [[Data shared] regionById:[Filters regionId]]; 70 | [self.regionButton setTitle:val.name forState:UIControlStateNormal]; 71 | } 72 | 73 | if ([Filters productId] == nil) { 74 | [self.productButton setTitle:@"All" forState:UIControlStateNormal]; 75 | }else { 76 | Product *val = [[Data shared] productById:[Filters productId]]; 77 | [self.productButton setTitle:val.name forState:UIControlStateNormal]; 78 | } 79 | 80 | if ([Filters salesRepId] == nil) { 81 | [self.salesRepButton setTitle:@"All" forState:UIControlStateNormal]; 82 | }else { 83 | SalesRep *val = [[Data shared] salesRepById:[Filters salesRepId]]; 84 | [self.salesRepButton setTitle:val.name forState:UIControlStateNormal]; 85 | } 86 | } 87 | 88 | - (void)showPickerFor:(NSArray*)items key:(FilterKey)key { 89 | self.currentFilterItems = items; 90 | self.currentFilterKey = key; 91 | self.selectedFitlerItem = [Filters filterValueForKey:key]; 92 | 93 | [self.pickerView reloadAllComponents]; 94 | 95 | CGFloat height = [[UIScreen mainScreen] bounds].size.height; 96 | CGPoint offScreenBelow = CGPointMake(0, height); 97 | CGPoint onScreen = CGPointMake(0, height - self.pickerView.frame.size.height); 98 | CGRect frame = self.pickerView.frame; 99 | frame.size = CGSizeMake(self.view.bounds.size.width, frame.size.height); 100 | frame.origin = offScreenBelow; 101 | self.pickerView.frame = frame; 102 | 103 | self.overlayView.hidden = YES; 104 | self.overlayView.frame = [UIScreen mainScreen].bounds; 105 | [[[UIApplication sharedApplication] keyWindow] addSubview:self.overlayView]; 106 | [[[UIApplication sharedApplication] keyWindow] addSubview:self.pickerView]; 107 | 108 | if (self.selectedFitlerItem != nil) { 109 | int val = [self.selectedFitlerItem intValue]; 110 | 111 | if (self.currentFilterKey == FilterKeyYear || self.currentFilterKey == FilterKeyQuarter) { 112 | [self.pickerView selectRow:[items indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { 113 | return [(NSNumber*)obj intValue] == val; 114 | }] + 1 inComponent:0 animated:NO]; 115 | }else { 116 | [self.pickerView selectRow:[items indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { 117 | return [(IdNameModel*)obj identifier] == val; 118 | }] + 1 inComponent:0 animated:NO]; 119 | } 120 | }else { 121 | [self.pickerView selectRow:0 inComponent:0 animated:NO]; 122 | } 123 | 124 | [UIView animateWithDuration:0.3 125 | animations:^{ 126 | CGRect frame = self.pickerView.frame; 127 | frame.origin = onScreen; 128 | self.pickerView.frame = frame; 129 | } 130 | completion:^(BOOL finished){ 131 | self.overlayView.hidden = NO; 132 | }]; 133 | } 134 | 135 | - (IBAction)hideFilter:(id)sender { 136 | NSInteger selectedIndex = [self.pickerView selectedRowInComponent:0]; 137 | if (selectedIndex == 0) { 138 | [Filters setFilterValue:nil forKey:self.currentFilterKey]; 139 | }else { 140 | if (self.currentFilterKey == FilterKeyYear || self.currentFilterKey == FilterKeyQuarter) { 141 | [Filters setFilterValue:[self.currentFilterItems objectAtIndex:(selectedIndex - 1)] forKey:self.currentFilterKey]; 142 | }else { 143 | [Filters setFilterValue:[NSNumber numberWithInt:[(IdNameModel*)[self.currentFilterItems objectAtIndex:(selectedIndex - 1)] identifier]] 144 | forKey:self.currentFilterKey]; 145 | } 146 | } 147 | [self updateFilters]; 148 | 149 | CGPoint offScreenBelow = CGPointMake(0, self.view.frame.size.height); 150 | [UIView animateWithDuration:0.3 151 | animations:^{ 152 | CGRect frame = self.pickerView.frame; 153 | frame.origin = offScreenBelow; 154 | self.pickerView.frame = frame; 155 | } 156 | completion:^(BOOL finished){ 157 | [self.overlayView removeFromSuperview]; 158 | [self.pickerView removeFromSuperview]; 159 | }]; 160 | } 161 | 162 | - (IBAction)filterByYears:(id)sender { 163 | [self showPickerFor:[[Data shared] years] key:FilterKeyYear]; 164 | } 165 | - (IBAction)filterByQuarters:(id)sender { 166 | [self showPickerFor:@[@1, @2, @3, @4] key:FilterKeyQuarter]; 167 | } 168 | - (IBAction)filterByIndustry:(id)sender { 169 | [self showPickerFor:[[Data shared] industries] key:FilterKeyIndustryId]; 170 | } 171 | - (IBAction)filterByRegion:(id)sender { 172 | [self showPickerFor:[[Data shared] regions] key:FilterKeyRegionId]; 173 | } 174 | - (IBAction)filterByProduct:(id)sender { 175 | [self showPickerFor:[[Data shared] products] key:FilterKeyProductId]; 176 | } 177 | - (IBAction)filterBySalesRep:(id)sender { 178 | [self showPickerFor:[[Data shared] salesReps] key:FilterKeySalesRepId]; 179 | } 180 | 181 | #pragma mark UIPickerViewDataSource, UIPickerViewDelegate 182 | 183 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { 184 | return 1; 185 | } 186 | 187 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { 188 | return self.currentFilterItems.count + 1; 189 | } 190 | 191 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { 192 | if (row == 0) 193 | return @"All"; 194 | 195 | id val = [self.currentFilterItems objectAtIndex:(row-1)]; 196 | if (self.currentFilterKey == FilterKeyYear || self.currentFilterKey == FilterKeyQuarter) { 197 | return [(NSNumber*)val stringValue]; 198 | }else { 199 | return [(IdNameModel*)val name]; 200 | } 201 | } 202 | 203 | @end 204 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/IdNameModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // IdNameModel.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/21/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IdNameModel : NSObject 12 | 13 | @property (readonly) int identifier; 14 | @property (readonly) NSString* name; 15 | 16 | - (id)initWithId:(int)identifier name:(NSString*)name; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/IdNameModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // IdNameModel.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/21/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "IdNameModel.h" 10 | 11 | @implementation IdNameModel 12 | 13 | - (id)initWithId:(int)identifier name:(NSString *)name { 14 | self = [super init]; 15 | if (self) { 16 | _identifier = identifier; 17 | _name = [NSString stringWithString:name]; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Industry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Industry.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "IdNameModel.h" 10 | 11 | @interface Industry : IdNameModel 12 | 13 | + (Industry*)industryWithId:(int)industryId name:(NSString*)name; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Industry.m: -------------------------------------------------------------------------------- 1 | // 2 | // Industry.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "Industry.h" 10 | 11 | @implementation Industry 12 | 13 | + (Industry*)industryWithId:(int)industryId name:(NSString*)name { 14 | return [[Industry alloc] initWithId:industryId name:name]; 15 | } 16 | 17 | - (NSString*)description { 18 | return [NSString stringWithFormat:@"[Industry id=%i, name=%@]", self.identifier, self.name]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Product.h: -------------------------------------------------------------------------------- 1 | // 2 | // Product.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "IdNameModel.h" 10 | 11 | @interface Product : IdNameModel 12 | 13 | @property (readonly) int industryId; 14 | 15 | + (Product*)productWithId:(int)productId industry:(int)industryId name:(NSString*)name; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Product.m: -------------------------------------------------------------------------------- 1 | // 2 | // Product.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "Product.h" 10 | 11 | @implementation Product 12 | 13 | + (Product*)productWithId:(int)productId industry:(int)industryId name:(NSString*)name { 14 | Product *res = [[Product alloc] initWithId:productId name:name]; 15 | res->_industryId = industryId; 16 | return res; 17 | } 18 | 19 | - (NSString*)description { 20 | return [NSString stringWithFormat:@"[Product id=%i, industry_id=%i, name=%@]", self.identifier, self.industryId, self.name]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Region.h: -------------------------------------------------------------------------------- 1 | // 2 | // Region.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "IdNameModel.h" 10 | 11 | @interface Region : IdNameModel 12 | 13 | + (Region*)regionWithId:(int)regionId name:(NSString*)name; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/Region.m: -------------------------------------------------------------------------------- 1 | // 2 | // Region.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "Region.h" 10 | 11 | @implementation Region 12 | 13 | + (Region*)regionWithId:(int)regionId name:(NSString*)name { 14 | return [[Region alloc] initWithId:regionId name:name]; 15 | } 16 | 17 | - (NSString*)description { 18 | return [NSString stringWithFormat:@"[Region id=%i, name=%@]", self.identifier, self.name]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/SalesRep.h: -------------------------------------------------------------------------------- 1 | // 2 | // SalesRep.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "IdNameModel.h" 10 | 11 | @interface SalesRep : IdNameModel 12 | 13 | + (SalesRep*)salesRepWithId:(int)salesId name:(NSString*)name; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Classes/SalesRep.m: -------------------------------------------------------------------------------- 1 | // 2 | // SalesRep.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "SalesRep.h" 10 | 11 | @implementation SalesRep 12 | 13 | + (SalesRep*)salesRepWithId:(int)salesId name:(NSString*)name { 14 | return [[SalesRep alloc] initWithId:salesId name:name]; 15 | } 16 | 17 | - (NSString*)description { 18 | return [NSString stringWithFormat:@"[SalesRep id=%i, name=%@]", self.identifier, self.name]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /AnyChartObjCSample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /AnyChartObjCSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.anychart.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | MainIPhone 29 | UIMainStoryboardFile~ipad 30 | MainIPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationPortraitUpsideDown 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /AnyChartObjCSample/MainIPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 205 | 214 | 220 | 229 | 235 | 244 | 250 | 256 | 265 | 274 | 280 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | -------------------------------------------------------------------------------- /AnyChartObjCSample/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /AnyChartObjCSample/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import "MainViewController.h" 10 | #import "Data.h" 11 | #import "Filters.h" 12 | 13 | @interface MainViewController () { 14 | BOOL firstRenderCompleted; 15 | BOOL filtersVisible; 16 | } 17 | 18 | @property (weak, nonatomic) IBOutlet UIWebView *webView; 19 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicatorView; 20 | @property (weak, nonatomic) IBOutlet UIPickerView *pickerView; 21 | @property (weak, nonatomic) IBOutlet UIButton *filtersButton; 22 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *pickerViewTopSpace; 23 | 24 | @property NSArray* years; 25 | @property NSArray* quarters; 26 | @property NSArray* industries; 27 | @property NSArray* products; 28 | @property NSArray* regions; 29 | @property NSArray* salesReps; 30 | 31 | @end 32 | 33 | @implementation MainViewController 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | self.years = [Data shared].years; 39 | self.industries = [Data shared].industries; 40 | self.products = [Data shared].products; 41 | self.regions = [Data shared].regions; 42 | self.salesReps = [Data shared].salesReps; 43 | self.quarters = @[@"Q1", @"Q2", @"Q3", @"Q4"]; 44 | 45 | firstRenderCompleted = NO; 46 | filtersVisible = NO; 47 | 48 | self.pickerViewTopSpace.constant = -self.pickerView.frame.size.height; 49 | 50 | [self.webView loadRequest: 51 | [NSURLRequest requestWithURL: 52 | [NSURL fileURLWithPath: 53 | [[NSBundle mainBundle] pathForResource:@"charts" ofType:@"html"] isDirectory:NO]]]; 54 | } 55 | 56 | - (void)webViewDidFinishLoad:(UIWebView *)webView { 57 | if (!webView.loading && !firstRenderCompleted) { 58 | [self setChartsData]; 59 | } 60 | } 61 | 62 | - (void)viewWillAppear:(BOOL)animated { 63 | [super viewWillAppear:animated]; 64 | 65 | [self setSelectedFilter:[Filters year] forComponent:FilterKeyYear]; 66 | [self setSelectedFilter:[Filters quarter] forComponent:FilterKeyQuarter]; 67 | [self setSelectedFilter:[Filters industryId] forComponent:FilterKeyIndustryId]; 68 | [self setSelectedFilter:[Filters productId] forComponent:FilterKeyProductId]; 69 | [self setSelectedFilter:[Filters regionId] forComponent:FilterKeyRegionId]; 70 | [self setSelectedFilter:[Filters salesRepId] forComponent:FilterKeySalesRepId]; 71 | } 72 | 73 | - (void)viewDidAppear:(BOOL)animated { 74 | [super viewDidAppear:animated]; 75 | if (firstRenderCompleted) { 76 | [self setChartsData]; 77 | } 78 | } 79 | 80 | - (void)setChartsData { 81 | NSMutableDictionary* data = [[NSMutableDictionary alloc] init]; 82 | [data setObject:[[Data shared] revenueByIndustryInYear:[Filters year] 83 | inQuarter:[Filters quarter] 84 | forProduct:[Filters productId] 85 | inRegion:[Filters regionId] 86 | forIndustry:[Filters industryId] 87 | salesRep:[Filters salesRepId]] 88 | forKey:@"revenue-by-industry"]; 89 | [data setObject:[[Data shared] revenueBySalesRepInYear:[Filters year] 90 | inQuarter:[Filters quarter] 91 | forProduct:[Filters productId] 92 | inRegion:[Filters regionId] 93 | forIndustry:[Filters industryId] 94 | salesRep:[Filters salesRepId]] 95 | forKey:@"revenue-by-sales"]; 96 | [data setObject:[[Data shared] revenueByProductInYear:[Filters year] 97 | inQuarter:[Filters quarter] 98 | forProduct:[Filters productId] 99 | inRegion:[Filters regionId] 100 | forIndustry:[Filters industryId] 101 | salesRep:[Filters salesRepId]] 102 | forKey:@"revenue-by-product"]; 103 | [data setObject:[[Data shared] revenueByQuarterInYear:[Filters year] 104 | inQuarter:[Filters quarter] 105 | forProduct:[Filters productId] 106 | inRegion:[Filters regionId] 107 | forIndustry:[Filters industryId] 108 | salesRep:[Filters salesRepId]] 109 | forKey:@"revenue-by-quarter"]; 110 | 111 | NSError* error; 112 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:data options:NSJSONWritingPrettyPrinted error:&error]; 113 | if (error) { 114 | NSLog(@"JSON generation failed: %@", error); 115 | }else { 116 | NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 117 | [self.webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"showCharts(%@)", jsonString]]; 118 | } 119 | 120 | firstRenderCompleted = YES; 121 | [self.activityIndicatorView stopAnimating]; 122 | } 123 | 124 | - (IBAction)toggleFilters:(id)sender { 125 | filtersVisible = !filtersVisible; 126 | [self.view layoutIfNeeded]; 127 | if (filtersVisible) { 128 | self.pickerViewTopSpace.constant = 0; 129 | [self.filtersButton setTitle:@"Apply" forState:UIControlStateNormal]; 130 | }else { 131 | self.pickerViewTopSpace.constant = -self.pickerView.frame.size.height; 132 | [self.filtersButton setTitle:@"Filters" forState:UIControlStateNormal]; 133 | [self.activityIndicatorView startAnimating]; 134 | dispatch_async(dispatch_get_main_queue(), ^{ 135 | [self updateCharts]; 136 | }); 137 | 138 | } 139 | 140 | [UIView animateWithDuration:0.3 animations:^{ 141 | [self.view layoutIfNeeded]; 142 | }]; 143 | } 144 | 145 | - (void)updateCharts { 146 | if (firstRenderCompleted) { 147 | [self.webView stringByEvaluatingJavaScriptFromString:@"clear();"]; 148 | [self.activityIndicatorView startAnimating]; 149 | [self setChartsData]; 150 | } 151 | } 152 | 153 | #pragma mark UIPickerViewDataSource, UIPickerViewDelegate 154 | 155 | - (void)setSelectedFilter:(id)value forComponent:(FilterKey)component { 156 | if (value == nil) { 157 | [self.pickerView selectRow:0 inComponent:component animated:NO]; 158 | }else { 159 | if (component == FilterKeyYear) { 160 | [self.pickerView selectRow:[self.years indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { 161 | return [(NSNumber*)obj intValue] == [(NSNumber*)value intValue]; 162 | }] + 1 inComponent:component animated:NO]; 163 | }else if (component == FilterKeyQuarter) { 164 | [self.pickerView selectRow:[[self pickerItemsForComponent:component] indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { 165 | return [(NSString*)obj isEqualToString:[NSString stringWithFormat:@"Q%@", value]]; 166 | }] + 1 inComponent:component animated:NO]; 167 | }else { 168 | [self.pickerView selectRow:[[self pickerItemsForComponent:component] indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { 169 | return [(IdNameModel*)obj identifier] == [(NSNumber*)value intValue]; 170 | }] + 1 inComponent:component animated:NO]; 171 | } 172 | } 173 | } 174 | 175 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { 176 | return 6; 177 | } 178 | 179 | - (NSArray*)pickerItemsForComponent:(NSInteger)component { 180 | if (component == FilterKeyYear) return self.years; 181 | if (component == FilterKeyQuarter) return self.quarters; 182 | if (component == FilterKeyIndustryId) return self.industries; 183 | if (component == FilterKeyProductId) return self.products; 184 | if (component == FilterKeyRegionId) return self.regions; 185 | if (component == FilterKeySalesRepId) return self.salesReps; 186 | return nil; 187 | } 188 | 189 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { 190 | return [self pickerItemsForComponent:component].count + 1; 191 | } 192 | 193 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { 194 | if (row == 0) 195 | return @"All"; 196 | 197 | id val = [[self pickerItemsForComponent:component] objectAtIndex:(row-1)]; 198 | if (component == FilterKeyYear) { 199 | return [(NSNumber*)val stringValue]; 200 | }else if (component == FilterKeyQuarter) { 201 | return val; 202 | }else { 203 | return [(IdNameModel*)val name]; 204 | } 205 | } 206 | 207 | - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { 208 | NSNumber *value; 209 | if (row == 0) { 210 | value = nil; 211 | }else if (component == FilterKeyQuarter) { 212 | value = [NSNumber numberWithInt:row]; 213 | }else if (component == FilterKeyYear) { 214 | value = [[self pickerItemsForComponent:component] objectAtIndex:(row - 1)]; 215 | }else { 216 | value = [NSNumber numberWithInt:[(IdNameModel*)([[self pickerItemsForComponent:component] objectAtIndex:(row - 1)]) identifier]]; 217 | } 218 | [Filters setFilterValue:value forKey:component]; 219 | } 220 | 221 | @end 222 | -------------------------------------------------------------------------------- /AnyChartObjCSample/bar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 |
18 | 35 | 36 | -------------------------------------------------------------------------------- /AnyChartObjCSample/charts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 23 | 63 | 64 | -------------------------------------------------------------------------------- /AnyChartObjCSample/column.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 |
18 | 36 | 37 | -------------------------------------------------------------------------------- /AnyChartObjCSample/line.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 |
18 | 35 | 36 | -------------------------------------------------------------------------------- /AnyChartObjCSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AnyChartObjCSample 4 | // 5 | // Created by Alexandr Batcuyev on 9/17/15. 6 | // Copyright (c) 2015 AnyChart. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /AnyChartObjCSample/pie.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 |
18 | 36 | 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | 4 | pod 'FMDB' 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # anychart iOS Objective C sample 2 | This example shows how to use AnyChart charting library in iOS application with SQLite database. 3 | 4 | ## Requirenments 5 | * XCode 6+ 6 | * Cocoa Pods 7 | 8 | ## Preview 9 | ![iPad](ipad.gif) 10 | ![iPhone](iphone.gif) 11 | 12 | ## Setup project 13 | Run `pod install` before opening, then open AnyChartObjCSample xcode workspace. 14 | 15 | ## License 16 | AnyChart iOS integration sample includes two parts: 17 | - Code of the integration sample that allows to use Javascript library (in this case, AnyChart) with iOS. You can use, edit, modify it, use it with other Javascript libraries without any restrictions. It is released under [Apache 2.0 License](https://github.com/anychart-integrations/anychart-ios-objc-sample/blob/master/LICENSE). 18 | - AnyChart JavaScript library. It is released under Commercial license. You can test this plugin with the trial version of AnyChart. Our trial version is not limited by time and doesn't contain any feature limitations. Check details [here](https://www.anychart.com/buy/). 19 | 20 | If you have any questions regarding licensing - please contact us. 21 | 22 | [![Analytics](https://ga-beacon.appspot.com/UA-228820-4/Integrations/anychart-ios-objc-sample?pixel&useReferer)](https://github.com/igrigorik/ga-beacon) 23 | -------------------------------------------------------------------------------- /ipad.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anychart-integrations/anychart-ios-objc-sample/b02cdec44623569e4f3ac3955e95c27418d4ea42/ipad.gif -------------------------------------------------------------------------------- /iphone.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anychart-integrations/anychart-ios-objc-sample/b02cdec44623569e4f3ac3955e95c27418d4ea42/iphone.gif --------------------------------------------------------------------------------