iOSPlot icon indicating copy to clipboard operation
iOSPlot copied to clipboard

Real time

Open massdonati opened this issue 11 years ago • 1 comments

Could I use iOS plot for realtime (30 redraws per second)?

massdonati avatar Mar 27 '14 18:03 massdonati

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

ghost avatar May 01 '14 20:05 ghost