real time plotting on iPhone using core plot?
I want to use core-plot for drawing line graph dynamically. data won’t come at a time, we will be receiving point by point dynamically.
Is it possible to draw the chart dynamically using core-plot i.e drawing point by point as on when we receive the (x,y) point?
Please help me, Thanks.
2 Solutions Collect From Internet About “real time plotting on iPhone using core plot?”
Yes, you can do this reasonably easily. For each received data point, append it to an array of values to display. As these data points come in, call
-reloadData on the Core Plot graph (or just the particular plot) to redraw the graph, passing in the array you just added a value to in response to the
-numbersForPlot:field:recordIndexRange: delegate method.
If you need to adjust the plot range to track your data points (for a moving ticker), recalculate the new CPPlotRange for the X axis and set the plot space’s
xRange property to that.
Use the CPTestApp-iPhone, AAPLot, or StockPlot examples as templates for how to set up the line chart overall, and modify from that starting point.
I do something similar to this on the Mac in a scientific application:
alt text http://www.sunsetlakesoftware.com/sites/default/files/SensingInAirAgain.jpg
Sounds like you could make use of a demo project I put together and wrote about here (not core plot related though).
It draws a EKG graph but should easily be modified to use another input than the repeated “heart beat”…See line 320 in EAGLView.m where the indata is entered into the array.
- Alamofire Error Domain=NSURLErrorDomain Code=-999 “cancelled”
- iOS 9 Splash screen is black
- How do you set a texture to tile in Sprite Kit
- ios 8 change the size of presented/modal view controller
- How to return values from Haneke's async fetch method
- How do you remove the Next and Prev buttons from virtual keyboard in Sencha Touch / Phonegap application
- Create view based NSTableView programmatically using Bindings in Swift
- show a button on getting json response equal to a string like @“unapproved”
- HTML Content fit in UIWebview without zooming out
- Swift 3: Expression implicitly coerced from 'UIView?' to Any
- Swift: how to work around issue where weak variable of type 'protocol' is illegal
- iOS 6.0 AutoLayout issue with constraints: subviews disappear when rotated
- Deleting objects within a for loop from a NSMutableArray
- AWS SNS Weird Error
- Passing values from one view controller to another in Swift