You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/danielgindi/Charts/releases)[](http://cocoapods.org/pods/charts)[](https://github.com/Carthage/Carthage)[](https://travis-ci.org/danielgindi/Charts)
5
5
[](https://gitter.im/danielgindi/Charts?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
6
7
-
## Just a heads up: We've renamed from *ios-charts* to **Charts**.
8
-
9
-
* Xcode 7.3 / Swift 2.2 / 3.0
10
-
* iOS 7.0 (Drag .swift files to your project)
11
-
* iOS 8.0 / 9.0 (Use as an **Embedded** Framework)
12
-
* tvOS 9.0
13
-
* OSX 10.11
7
+
* Xcode 8.0 / Swift 2.3
8
+
* iOS >= 8.0 (Use as an **Embedded** Framework)
9
+
* tvOS >= 9.0
10
+
* macOS >= 10.11
14
11
15
12
Okay so there's this beautiful library called [MPAndroidChart](https://github.com/PhilJay/MPAndroidChart) by [Philipp Jahoda](https://www.linkedin.com/in/philippjahoda) which has become very popular amongst Android developers, and in the meanwhile there's no decent charting solution for iOS.
16
13
17
14
I've chosen to write it in `Swift` as it can be highly optimized by the compiler, and can be used in both `Swift` and `ObjC` project. The demo project is written in `ObjC` to demonstrate how it works.
18
15
19
-
**An amazing feature** of this library now, for Android, iOS, tvOS and OSX, is the time it saves you when developing for both platforms, as the learning curve is singleton- it happens only once, and the code stays very similar so developers don't have to go around and re-invent the app to produce the same output with a different library. (And that's not even considering the fact that there's not really another good choice out there currently...)
16
+
**An amazing feature** of this library now, for Android, iOS, tvOS and macOS, is the time it saves you when developing for both platforms, as the learning curve is singleton- it happens only once, and the code stays very similar so developers don't have to go around and re-invent the app to produce the same output with a different library. (And that's not even considering the fact that there's not really another good choice out there currently...)
17
+
18
+
## Having trouble running the demo?
19
+
20
+
*`ChartsDemo/ChartsDemo.xcodeproj` is the demo project for iOS/tvOS
21
+
*`ChartsDemo-OSX/ChartsDemo-OSX.xcodeproj` is the demo project for macOS
22
+
* Make sure you are running a supported version of Xcode.
23
+
* Usually it is specified here a few lines above.
24
+
* In most cases it will be the latest Xcode version.
25
+
* Make sure that your project supports Swift 2.3
26
+
* Run `carthage checkout` in the project folder, to fetch dependencies (i.e Realm).
27
+
* Realm is not required for using Charts - it is just a feature. But as the demo demonstrates Realm - you have to have it when running the demo.
28
+
* If you don't have Carthage - you can get it [here](https://github.com/Carthage/Carthage/releases).
29
+
20
30
21
31
## Usage
22
32
23
33
In order to correctly compile:
24
34
25
35
1. Drag the `Charts.xcodeproj` to your project
26
36
2. Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework
27
-
3.**Temporary workaround**: Xcode 6.3.1 has a bug, where you have to build your project once before actually writing the `@import` line. So hit "Build" now!
28
-
4.`@import Charts`
29
-
5. When using Swift in an ObjC project:
37
+
3.`@import Charts`
38
+
4. When using Swift in an ObjC project:
30
39
- You need to import your Bridging Header. Usually it is "*YourProject-Swift.h*", so in ChartsDemo it's "*ChartsDemo-Swift.h*". Do not try to actually include "*ChartsDemo-Swift.h*" in your project :-)
31
40
- Under "Build Options", mark "Embedded Content Contains Swift Code"
32
-
6. When using [Realm.io](https://realm.io/):
41
+
5. When using [Realm.io](https://realm.io/):
33
42
- Note that the Realm framework is not linked with Charts - it is only there for *optional* bindings. Which means that you need to have the framework in your project, and in a compatible version to whatever is compiled with Charts. We will do our best to always compile against the latest version.
34
43
35
-
36
-
If you want to compile for iOS 7:
37
-
38
-
1. Drag the code itself (.swift files) to your project. As sadly, Swift currently does not support compiling Frameworks for iOS 7.
39
-
2. Make sure that the files are added to the Target membership.
40
-
41
44
## Troubleshooting
42
45
43
46
#### Can't compile?
@@ -70,8 +73,8 @@ pod 'Charts/Realm'
70
73
Charts now include Carthage prebuilt binaries.
71
74
72
75
```carthage
73
-
github "danielgindi/Charts" == 2.2.5
74
-
github "danielgindi/Charts" ~> 2.2.5
76
+
github "danielgindi/Charts" == 2.3.0
77
+
github "danielgindi/Charts" ~> 2.3.0
75
78
```
76
79
77
80
In order to build the binaries for a new release, use `carthage build --no-skip-current && carthage archive Charts && carthage archive ChartsRealm`.
@@ -176,7 +179,7 @@ Features
176
179
177
180
Documentation
178
181
=======
179
-
Currently there's no need for documentation for the iOS/tvOS/OSX version, as the API is **95% the same** as on Android.
182
+
Currently there's no need for documentation for the iOS/tvOS/macOS version, as the API is **95% the same** as on Android.
180
183
You can read the official [MPAndroidChart](https://github.com/PhilJay/MPAndroidChart) documentation here: [**Wiki**](https://github.com/PhilJay/MPAndroidChart/wiki)
181
184
182
185
Or you can see the [**ChartsDemo**](https://github.com/danielgindi/Charts/tree/master/ChartsDemo) project and learn the how-tos from it.
@@ -201,4 +204,4 @@ Unless required by applicable law or agreed to in writing, software
201
204
distributed under the License is distributed on an "AS IS" BASIS,
202
205
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
206
See the License for the specific language governing permissions and
0 commit comments