Skip to content
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

Plotting Realm data in Swift. RLMResults not available #898

Closed
bb-git opened this issue Mar 29, 2016 · 9 comments
Closed

Plotting Realm data in Swift. RLMResults not available #898

bb-git opened this issue Mar 29, 2016 · 9 comments
Assignees

Comments

@bb-git
Copy link

bb-git commented Mar 29, 2016

I get the following error when trying to use the constructor:
Cannot convert value of 'Results<()>' to expected argument type 'RLMResults?'

let historyItems = realm.objects(History)     
let dataSet = RealmLineDataSet(results: historyItems, yValueField: "row1", xIndexField: "row2", label: nil)

Has anybody managed this? I can't find a solution

@danielgindi
Copy link
Collaborator

Due to some limitations to Realm's implementation, we couldn't support the Swift Results class, but only the RLMResults. With the latest version I have to check- they may have fixed that and maybe we can too.

@StevenMasini
Copy link

Do we have a solution or a work-around for this issue ?

@danielgindi
Copy link
Collaborator

Not at the moment.

@AndyDunn
Copy link

Does this effectively mean that Realm Charts can't currently be used with Swift? I'm having the same issue and have converted everything else to work but this one line of code.

@bb-git
Copy link
Author

bb-git commented Apr 29, 2016

You can use it using Realm for objective-c. Realm for objective-c will also work in Swift. I didn’t do it, had to many adaptions anyway.

On Apr 29, 2016, at 9:49 AM, Andy Dunn notifications@github.com wrote:

Does this effectively mean that Realm Charts can't currently be used with Swift? I'm having the same issue and have converted everything else to work but this one line of code.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@AndyDunn
Copy link

@bb-git I'm thinking of just using regular Charts for Swift (no Realm) and converting my existing Realm dataset into normal arrays for the data. That seems like the option with the least amount of effort.

@StevenMasini
Copy link

Yes it's what I've done too.

@bb-git
Copy link
Author

bb-git commented Apr 29, 2016

I created the datasets directly iterating over the results, without using arrays

On Apr 29, 2016, at 10:03 AM, Andy Dunn notifications@github.com wrote:

@bb-git
I'm thinking of just using regular Charts for Swift (no Realm) and converting my existing Realm dataset into normal arrays for the data. That seems like the option with the least amount of effort.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@danielgindi
Copy link
Collaborator

realm/realm-swift#4232

sean-saathoff-ua added a commit to underarmour/Charts that referenced this issue Jun 2, 2017
* added test image to demo project

* all datasets via superclass: added var drawIconsEnabled, func isDrawIconsEnabled() and var iconOffset

* utils: drawImage(context:image:point:expectedSize:offset:)

* all renderers are drawing icon image if it is stored in entitie's data property and dataset allows

* some demos updated to toggle icons

* unit tests

* fix: misplacement of icon. Now icon is drawn correctly centered.

* allow to make vertical-only offset for icons on Pie and Radar charts (in addition to distance from center)

* drawBottomYLabelEntryEnabled (Closes ChartsOrg#1006)

* resetZoom() (Closes ChartsOrg#1179)

* Correctly position 0 in stacked bar (Closes ChartsOrg#1195, #closes ChartsOrg#1191)

* Update "Usage" section of README

Updates README.md to reflect changes made to "Build Options" in Xcode 8.2+.

* Removed embedded Realm leftover from repo

* Use realm-cocoa 2.1.1 for ObjectiveCSupport (Closes ChartsOrg#898, resolves ChartsOrg#1594)

* Updated project settings

* Add support for extensions

* Fix NSCopying implementation in CandleChartDataEntry

* Update RealmSwift Dependency

* update configurations for xcode 8.2

* fix a typo, as orientation is horizontal by default

* close ChartsOrg#2066

* update rakefile for ios 10.x simulators

* Adds NSPhotoLibraryUsageDescription to plist of ChartsDemo to prevent crash on iOS 10 on try to store shot of char to photo library.

* 'backgroundColor' is inaccessible due to 'internal' protection level on mac OS X ChartsOrg#2135

* Fixes index out of range crash.

* add github token to .travis.yml to fix builds?

* Code styling

* Fixed dependency of drawing values on isDrawIconsEnabled

* CGPoint is more appropriate here

* Do not repeat the scaling procedure if we can cache it

* Docs

* Deprecated weird constructor

* Use a designated icon property and constructors

* More refactoring to icons drawing

* Disabled icons by default in examples

* Fixes for icon tests

* Reverted basic test images from pr (ChartsOrg#1793)

* Improved feb29 formula

* Fixed the inconsistency of AxisMax and AxisMin

When enabled autoScale.
`data.calcMinMaxY(fromX: self.lowestVisibleX, toX: self.highestVisibleX)` is called after 
` _leftYAxisRenderer?.computeAxis(min: _leftAxis._axisMinimum, max: _leftAxis._axisMaximum, inverted: _leftAxis.isInverted)`
`_rightYAxisRenderer?.computeAxis(min: _rightAxis._axisMinimum, max: _rightAxis._axisMaximum, inverted: _rightAxis.isInverted)`
`_xAxisRenderer?.computeAxis(min: _xAxis._axisMinimum, max: _xAxis._axisMaximum, inverted: false)`

that means _leftAxisRenderer and _rightAxisRenderer will render AxisLines and Values based on old values of _axisMinimum, _axisMaximum

* Tell Travis to wait more time when building carthage

* Always respect isEnabled

* Consider _yAxis.isDrawLimitLinesBehindDataEnabled for radar chart

* Updated to use Realm version 2.4.3

* fix Xcode 8.3 compiler warnings

* loosen realm version requirement

* Updated build-dependencies.sh

* Remove line width minimum constraint

* Moved Realm stuff to https://github.com/danielgindi/ChartsRealm

* Added @discardableResult to silence warnings when it’s safe to ignore result

* gitignore updates

* Removed unrequited script

* v3.0.2

* Removed leftover scheme

* Removed leftover script from the combined Realm era

* Converted swift 3.0 DBL_MIN leftover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants