-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
************* Migrating to Charts 3.0 ******************** #1474
Comments
@danielgindi Support cocoapods? |
@danielgindi can i still copy those classes to my project like before? |
Not yet in Cocoapods. As I've said it's not released yet. |
Yes you can copy it the classes like before. However it's more comfortable to drag the |
@danielgindi Now I have a issue, I notice that x-indexes are dead:
Then how can I show string(for example, a date string) on xAxis rather than float number(like 1.0, 2.0 ...)? Answer by Daniel:Get the NSTimeInterval of a date, NSTimeInterval is actually a double. Then Use formatter to custom it. |
Can't wait for the release! 👍 |
@danielgindi Since I updated to XCode 8.0, my project won't build because I have Charts installed via cocoapods and it's still using a legacy version of Swift. How soon can we expect a release of Charts 3.0, or what can I do to resolve these errors in the meantime? Thanks for all your efforts. |
Point your podfile to master branch instead of a version for now |
@Carielle To install Charts 3.0.0 before it is compatible with CocoaPods, remove the old Charts from your pod file and your project, and then download the Charts.xcodeproj file from this github page. Then open your target project in XCode and drag the Charts.xcodeproj file from the directory it downloaded to into your project in the XCode interface. After that, add Charts.framework in the "Embedded Binary" section of your project's General Settings. |
Point out a mistake in Migrating description :
|
I'm getting the same as @Carielle, will try what @HenryAlkire said |
What branch are you using? |
@rrecio It can't be.. I fixed this like a few days ago. |
I was using regular cocoapod setup: pod 'Charts' To fix it I removed the Podfile entry and linked Charts.framework manually as @Henry explained Enviado do meu iPhone
|
Any idea about when it will be available on Cocoapods ? |
How do I upgrade Charts to work with Xcode 8.0 and Swift 3.0 using Carthage? When I run "carthage update", it's still pulling Charts 2.3.0. My Cartfile is configured to use the latest version. Cartfile:github "danielgindi/Charts" Command line:$carthage update |
@danielgindi
|
Carthage uses the latest release version. If you want 3.0 (which isn't released yet) use |
Download Full project using master branch and then drag and drop Charts.xcodeproj and then go to General tab and add Charts.framework under Embedded Binaries after Clean and build so you can see all error are gone just try it. in case you required any help comment it i'll help you. @petester42 @Huang-Libo |
@HenryAlkire I did what you suggested and removed Charts from my podfile and dragged and dropped it manually into my project, and added it as an embedded binary. However, when I try to build the project I keep getting this error: |
I solved my own problem - my project is an Objective-C project using the Swift Charts library, so I had to go to Build Settings > Build Options > "Always Embed Swift Standard Libraries" and set it to YES. This replaces the deprecated "Embedded Content Contains Swift" flag. |
@rs10693 Oh, I see! the delegate is valueFormatter... |
@bingozb what can you say i don't understand. plz elaborate me. |
@danielgindi i am still not able to install Charts 3.0.0 Following error occurs when run
None of your spec sources contain a spec satisfying the dependency: You have either:
Note: as of CocoaPods 1.0, Please help does it means that Charts 3.0.0 is not released yet to install by using or am i missing any step. |
3.0 is not yet in cocoapods because it's not final. You can point to the git repo and master to get 3.0 right now |
We have now released 3.0.0! |
Thats great to know. But i am a bit worried do we need to update our cocoa pod or it's repository for installing newly released 3.0.0 |
woot 🎉 |
@danielgindi you need me to push the pod or you got that covered? |
Tried, now after a long time, said that the podspec does not validate... |
Ya it takes a while. I can do it. You need cocoapods 1.1 to work with Xcode 8/swift 3 |
@petester42 @danielgindi but still the Analysing dependencies Please guide |
It's working now after updating the master repo of pod thanks for help |
let chartDataSet = BarChartDataSet(values: dataEntries, label: nil) about xVals, you have to implement stringForValue. |
Thanks. how should I implement stringForValue for xVals. |
Please provide swift 3 examples |
Hello,
Thank you for the input. |
in class BarChartRenderer
add a variable if you want |
Thank you Thierry. I still have the issue of that weird spacing. So I just created a default bar chart with a 0 value and I still have the issue - I tried to get as close as possible to a simple bar to see what was the issue. It looks like the demo but a soon as I put a value between 0 and 0.9999 I get that padding. Here the sample code :
Pretty straightforward. It is a bug ? Thank you for the help ;) |
Where I can find docs about old API for Charts ? I never used this framework (aside from upgrading it few times) and I have to upgrade from 2.3 to 3.0.4, so old docs would be nice to figure out old code, eg:
Now, there is no init called
Also the valuesObjc array is missing now:
As I said, I never used this framework, so some help would be appreciated, or at least link to old API docs would be helpful... |
I don’t think such resource exists. You can check the legacy/2.3 branch to check the demos and such to compared with other hthe current version. |
BarChartData.init(xVals: xVals, dataSets: dataSets) can not work. what is replace it? |
How can I scroll the x value of line chart to the center programatically? |
Many have asked about how to migrate to Charts 3.0. So everything will be in the release notes soon as there will be a release, but I will write those down here for now:
This is a major release, with a few breaking changes. So please pay attention.
Updates:
x-index
es are dead. Intoducing: x-values. Each entry now has anx
and ay
.y
values, not inheriting from NSNumberFormatter anymore, to have dataSet and viewport information to take better formatting decisions.objc(...)
feature, and the change of a major version update)FillFormatter
now has a block representation usingFillFormatter.withblock(...)
saveToCameraRoll()
. Since Xcode 8.0 it causes "privacy" issues with Apple Review, you have to add the photo albums privacy key to yourInfo.plist
for that.Breaking changes / how to migrate:
PieChartDataEntry
/RadarChartDataEntry
startAtZeroEnabled
calls - these have been deprecated for a long time. Replace them withaxisMinimum
.chart.valueFormatter = formatter
withchart.valueFormatter = ChartDefaultValueFormatter(formatter: formatter)
orchart.valueFormatter = [[ChartDefaultValueFormatter alloc] initWithFormatter:formatter];
axis.valueFormatter = formatter
withaxis.valueFormatter = ChartDefaultAxisValueFormatter(formatter: formatter)
oraxis.valueFormatter = [[ChartDefaultAxisValueFormatter alloc] initWithFormatter:formatter];
ChartViewDelegate
is implemented, update thechartValueSelected
interfacedrawSliceTextEnabled
withdrawEntryLabelsEnabled
IShapeRenderer
, and put your rendering code in thereMarkerView
/MarkerImage
or implementingIMarker
. There are more options than before now...barSpace
before, move to usingbarWidth
saveToCameraRoll()
, replace withUIImageWriteToSavedPhotosAlbum(chart.getChartImage(trasparent: false), nil, nil, nil)
@objc(name)
. If your compiler yells that a class does not exist, try to remove the Chart from its name. This should rarely happen, as we've chosen only the classes that are rarely instantiated by the user.The text was updated successfully, but these errors were encountered: