iOSPlot
iOSPlot copied to clipboard
Real time
Could I use iOS plot for realtime (30 redraws per second)?
i solved this by adding the graphs PCLineChartView as subview of the root view with the setTag: method. upon refresh i just remove the old graph subviews by using their tags with removeFromSuperView and setup the graph with the refereshed data and add it as subview again.
// define a tag for your graphview
#define GRAPH_A 100
- (void) paintChart
{
// remove previous graph view from root view with using the views tag
[[self.view viewWithTag:GRAPH_A] removeFromSuperview];
// init your graph
// and set the graphs settings
_tlineChartView = [[PCLineChartView alloc] initWithFrame:CGRectMake(10,10,cellWidth,cellHeight)];
.. setup your graph here...
// add a tag to the graphview
[_tlineChartView setTag:GRAPH_A];
// add graph to view
[self.view addSubview:_tlineChartView];
}
hope this helps