Giter VIP home page Giter VIP logo

Comments (9)

Sam-Spencer avatar Sam-Spencer commented on July 18, 2024

@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.

Steven4294 avatar Steven4294 commented on July 18, 2024

Ok, that makes sense. How would you actually set the frame's equal?

SecondGraph.frame = FirstGraph.frame

from bemsimplelinegraph.

Sam-Spencer avatar Sam-Spencer commented on July 18, 2024

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.

Steven4294 avatar Steven4294 commented on July 18, 2024

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.

Sam-Spencer avatar Sam-Spencer commented on July 18, 2024

Every delegate and data source method has a graph parameter - and exactly for this reason. Just use that parameter.

from bemsimplelinegraph.

Steven4294 avatar Steven4294 commented on July 18, 2024

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).

screenshot

As it shows they are using different axis.

from bemsimplelinegraph.

paulrolfe avatar paulrolfe commented on July 18, 2024

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.

Sam-Spencer avatar Sam-Spencer commented on July 18, 2024

@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.

Sam-Spencer avatar Sam-Spencer commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.