objective c - Refresh core plot scatterplot -
i have scatterplot created using core plot (v 1.5). datasource dictionary containing (x, y, value). able dynamically adjust how many of (x, y) pairs plot. however, graphhostingview not refresh scatter-plot after alter number of (x, y) pairs contained in datasource until resize window. when resize window new values loaded , plotted. have tried several solutions including:
[graph reloaddata] [scatterplotview setneedsdisplay:yes] forcing phone call to: [self.myscatterplot.plotitem renderinview:self.myscatterplot.hostingview withtheme:nil animated:no withdata:nil]; without success. suggest method enable scatterplot dynamically updated when values alter or send me link example? in advance. cheers, trond
there several methods available tell core plot plot have new info available:
-reloaddata: replace of plot info new info points. calling method on graph causes plots in graph reload data.
-reloaddatainindexrange:: replace plot info in given index range new values leaving points outside range untouched.
-insertdataatindex:numberofrecords:: insert new info points @ given index, moving existing info points higher indices needed.
-deletedatainindexrange:: remove existing info in given range , move existing info points close gap.
the "real time plot" demo in plot gallery illustration app uses these methods update data. demo uses timer generate random plot info new info can come anywhere.
objective-c cocoa core-plot
No comments:
Post a Comment