Comments (9)
@Steven4294 I believe you are referring to @paulrolfe's fork of this project. That fork has not been merged into the project and is not officially supported. I recommend opening an issue on that fork or asking the developer of the fork how to use that feature. However, here's what I came up with after spending a few minutes with the fork:
The documentation (see the commit messages) on the fork describes how to create a second graph and set it as the lowerGraph
in the same frame as the main graph.
To make two lines, create a second graph object and place it in the same frame as your original in your view. Set the
lowerGraph
property of the top graph to equal the lower graph. Then make colors clear or transparent.
The code should look something like this (the first two lines are abbreviated pseudo-code):
BEMSimpleLineGraph *firstGraph = [doGraphSetup...];
BEMSimpleLineGraph *secondGraph = [doGraphSetupWithSameFrameAs:firstGraph...];
firstGraph.lowerGraph = secondGraph;
You may also want to watch Issue #44 (Multiple lines (series) support). By watching this issue you will be notified of changes in the issue status and receive email updates when something happens. We hope to (one day) officially support multiple lines on a single graph.
Because this issue is related to a specific fork (and no pull request has been submitted from that fork) I am going to close this issue. Let us know if there is anything else we can do. Thank you for using the library!
from bemsimplelinegraph.
Ok, that makes sense. How would you actually set the frame's equal?
SecondGraph.frame = FirstGraph.frame
from bemsimplelinegraph.
UIViews are quite peculiar when it comes to changing and setting their frame sizes. The best way to set the frame of the secondGraph
would be using the initWithFrame:
method (if you do so programmatically). The bounds
property may also work. The code you posted should also work.
from bemsimplelinegraph.
Thanks so much, you're a lifesaver - I've got that part working now.
One last thing, in the method for loading the data into the graph, I need to be able to distinguish between the firstGraph and secondGraph (since I have to return two separate data sets).
Programmatically I need something like:
if ([graph.name == FirstGraph)
// load first graph's data
But, how do I actually make this comparison between firstGraph and graph?
I'm really struggling with this for a few days now.... does anyone have a demo code I could see that implements two graphs using the lower graph property?
from bemsimplelinegraph.
Every delegate and data source method has a graph
parameter - and exactly for this reason. Just use that parameter.
from bemsimplelinegraph.
Ok i know that each method has a graph parameter, but how do I use it to differentiate between the upper graph and lower graph property? In other words, what would my reloadGraph method look like?
EDIT
Okay, I think I've figured that part out, but does this fork even use the same y-axis for both graphs? Or is it just superimposing both graphs on top of each other (which is relatively useless).
As it shows they are using different axis.
from bemsimplelinegraph.
Reload your top graph like normal, then your top graph, but then you also
need to call a reload on the bottom graph... you could use
[myGraph reloadGraph];
[bottomGraph reloadGraph]
or...
[myGraph reloadGraph];
[myGraph.lowerGraph reloadGraph];
Paul Rolfe
[email protected]
Red Ostrich LLC || http://paulrolfe.com
CapitolBuddy: iOS App
http://twitter.com/capitolbuddy || http://Facebook.com/CapitolBuddy
On Wed, Jul 9, 2014 at 6:27 PM, Steven4294 [email protected] wrote:
In other words, what would my reloadGraph method look like?
—
Reply to this email directly or view it on GitHub
#48 (comment)
.
from bemsimplelinegraph.
@Steven4294 Please use to the documentation and separate issue tracker for that specific fork. These features are not (yet) supported on the main repo.
from bemsimplelinegraph.
This issue is now locked as it no longer pertains to the main repo. Please direct all further inquiries, bug reports, and feature requests for that fork to that fork.
from bemsimplelinegraph.
Related Issues (20)
- How can i set fixed value for X-axis space between ?
- when my points count is two. enableBezierCurve = YES; Why the main line? HOT 2
- Scaling the values on y-axis HOT 2
- Today Extension drawing issue
- Graph not showing values for large data set HOT 3
- Point of Y Axis is not showing correctly. HOT 2
- Add multiples lines on Graph.? HOT 1
- Graph not working in iOS 10.0.1 HOT 2
- Can't update pod from 4.1 to 4.1.1 HOT 3
- Deprecated Code - self.viewForBaselineLayout HOT 1
- Long X-Axis Labels Hidden (iPhone 6 and above) HOT 2
- DataSource and Delegate use of `NSInteger` instead of `NSUInteger` in regards to Swift and Casting HOT 3
- Unavailable some functions after migrating to swift 3 HOT 2
- Long X-Axis Labels Hidden HOT 2
- Uneven X-Axis Label Spacing HOT 2
- How can we avoid the extra curve line? HOT 6
- How to customize the Gradient layer? HOT 1
- swift 4 HOT 1
- Is it possible to make some gaps on a same line plot?
- y axis values not visible HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bemsimplelinegraph.