iOS - Live Updating of Graphs

Oystein Bjorke 6 years ago 0
This discussion was imported from CodePlex

benhysell wrote at 2014-03-02 19:32:

When I have a new entry to update on my graphs, after initial draw, I'm not sure I'm using the most efficient method. Thoughts?
await graph.UpdateDataSources ();
((PlotView)View).Model.Update ();
View.SetNeedsDisplay ();
First graph the latest data from the database and set the ItemSource to the new data. Call Model.Update() to update the graph, and then invalidate the view.

It doesn't 'feel correct', wanted to know if anyone else had any thoughts on a better way to do it.

objo wrote at 2014-03-02 21:43:

The PlotView.InvalidatePlot method should do this.
I also recommend testing the version on the fork
where touch events are being implemented. I hope to be able to merge fork with default soon.

benhysell wrote at 2014-03-06 01:06:

((PlotView)View).Model.InvalidatePlot (true);
View.SetNeedsDisplay ();
I still needed to call View.SetNeedsDisplay (); for my view to update. I stayed in default, for my testing.