-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Live data Line Chart #754
Comments
You don't have to keep copying data from one array to another, init the charts with empty array and you can later add to it using addEntry().
` |
@chris-gunawardena thanks for answering all similar questions :) |
I want ot make a live chart live stock market charts which update and draw in every second update on chart can you help me please |
@MuhammadUsmanZiaAkram This should get you started. http://stackoverflow.com/questions/35339479/xcode-dynamic-live-update-line-chart/38543318#38543318 |
@chris-gunawardena thanks Dear |
@chris-gunawardena Hello..! In this function: |
@ikyh That's the y value to be drawn. which can be any number. |
@chris-gunawardena Thank you |
How to put a custom background image ? |
@chris-gunawardena , when I am running the code you share, I am getting 95% cpu usage continuously, is that normal for such a high data rate plotting. In my case i need ECG plotting at 8ms continuously.
|
@prashant3285 at 8ms you are updating it 125 times a second but maybe you can try to batch the readings and update the chart 30 fps or every 33ms. (Push the readings into an array buffer and read from it every 33ms). |
@chris-gunawardena Thanks for your prompt response. I saw a 10ms timer on your demo code so I tried 8ms timer. I also tested 32ms and 40ms timer with multiple data point entry at the same time, but I am not getting smooth graph animation. The cpu consumption does comes down to 40% which is still high. on Android the 8ms timer works just fine. Also tested Scichart iOS ECG demo, their animation is very smooth and cpu is at 10% max. I think they are using GPU unlike CPU in ios charts. |
I am looking to create a graph that will plot live data onto a line chart, need to plot around 5 a second, I am trying to create something like this
http://www.highcharts.com/demo/dynamic-update
I have had some moderate success with the Line Chart, but it is very jerky. The code I have tried so far looks like this
@IBOutlet weak var chartView: LineChartView!
var xAxisArray : [String]?
var yAxisArray : [Double]?
var date : NSDate?
var dateFormatter : NSDateFormatter?
I would like to have the x axis scroll similar to the example shown above. Is there a way to do this with iOS charts at present? Or is the charting framework not really made for live data charts like this?
Any help would be much appreciated
The text was updated successfully, but these errors were encountered: