Get every point plot data information when clicked on graph core plot - iphone

I am using the core plot to draw graph but i need to show every plot point info on touch on every plot coordinate.Please help me how can i show the info my data on every plot accordingly.
Thanks in advance.

I guess you should save the location and information of each plot point and check that against the touch you receive from the user. When you have drawn something on a canvas there is no way to ask it for information about a certain point.

Use a plot delegate to get notified of the touch. There are several examples in the Plot Gallery and CPTTestApp (Mac) example apps.

Related

how to draw a bar graph with tow y- axis in iOS?

I am using core-plot framework for drawing graphs. But I need to draw two bars with two y-axis. Please help providing sample code/example links.
Thanks in advance.
For your requirement this bellow link is very useful to you..also in this example many graphs and charts available
MIMChart-Library
and this tutorial with core-plot library
how-to-draw-graphs-with-core-plot-part
using-core-plot-to-draw-line-graphs
i hope this help you..
The "Axis Demo" in the Plot Gallery example app included with Core Plot shows how to do this. You create another axis and add it to the axes array of the axis set. The secondary y-axis can share the same plot space as the other axes or be assigned to another plot space if it needs to have a different scale.

Draw graph using accelerometer data in core-plot

I'm new to this core-plot framework and trying to draw a line graph based on X and Y acceleration. I can already get my X and Y values and have successfully added core-plot in my project. I'm quite lost on how to start this, so basically, I will have X and Y values and how do I plot this using core-plot? any help is suggested. Thanks!
Maybe my answer is a little bit off topic, as it's not using core-plot, but did you look at the "AccelerometerGraph" sample app provided with Xcode?
It provides a nice plot which is dynamically updated while new accelerometer events are registered. The great of this sample is the way CoreAnimation has been used to "speed-up" Quartz2D. And you get all of this using system framework only and no third party code (apart your adaptation of Apple's one).
Look at the Core Plot examples to see how to set up a basic graph. You'll want to use a scatter plot. Call -reloadData on the plot whenever you have new data to display. If only some of the data points change on each frame, you can use the following methods to do a partial update:
-(void)reloadDataInIndexRange:(NSRange)indexRange;
-(void)insertDataAtIndex:(NSUInteger)index
numberOfRecords:(NSUInteger)numberOfRecords;
-(void)deleteDataInIndexRange:(NSRange)indexRange;
The Real Time Plot in the Plot Gallery example app shows one way to use these methods.

How to draw a line on MKMapView showing the route a user has taken?

I have had a look around online to try and find out the best way to draw a line showing the route a user has travelled. I think I need to use the MKOverlayView, and I guess I need to collect a selection of data points to plot (would these be GPS coordinates?). The question I have is based on how I would draw the line and keep adding to it as the users location updates?
I also want to be able to clear the line when a user presses a button. How would I implement this (not the button press, just the code to clear the line off the map view)?
Thanks in advance!
You can do this using MKPolyline. At First you need to get coordinates of route, then draw polylines over it. You will find an example here to draw polyline over some coordinates.

Core Plot: Data point labels shown, or when data points touched?

Is there a way using Core Plot to have periodic labels assigned to data plots? Such as 10-20 labels listed across my plot points.
Here is an example (mockup) of what I am hoping to do:
Is it possible to do this when the graph loads, or maybe when you swipe across the graph you see the data points showing their call out?
You'll have to draw the callout bubbles yourself, but it is possible to label data points. To make a callout, you could subclass CPTextLayer and have it draw the bubble around the text. Use this new class to make your labels.
You can implement a datasource method to inform Core Plot which data points should be labeled and provide your own labels if you wish (this is how you'd do the callouts). You can also respond to touch events (click events on the Mac) and show a label for the point that was touched. You have to touch each point individually--you won't get the delegate notification if you drag from one point to the next.
The examples included with Core Plot demonstrate how both techniques work.

How to make the coordinate of a graph user interactive?

I have tried to plot a graph using Quartz 2D . It looks more like a drawing. But I am fixing the axes and plotting the coordinates according to the axes. But the problem is I want to make the graph user interactive. Each coordinate on the graph will further have to drill down showing the details of the coordinate. So how can I make the coordinates interactive .
Rather than rolling your own Quartz graph with interactivity, you might want to take a look at the Core Plot framework, which is available for Mac and iPhone. The stubs are there to provide user interactivity, but we haven't filled in any implementations of this yet.
If you wish, you can implement
-(BOOL)containsPoint:(CGPoint)thePoint
-(void)mouseOrFingerDownAtPoint:(CGPoint)interactionPoint
-(void)mouseOrFingerUpAtPoint:(CGPoint)interactionPoint
-(void)mouseOrFingerDraggedAtPoint:(CGPoint)interactionPoint
-(void)mouseOrFingerCancelled
within the appropriate CPLayer subclass to make that Core Plot element respond to user interaction. We will also be setting up a delegation pattern so that your controllers can handle the logic for interaction events as well.