improved display of graphs

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7614 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-10-16 19:17:17 +00:00
parent 01fdb95c30
commit b51c34d23b
7 changed files with 74 additions and 20 deletions

View file

@ -88,6 +88,17 @@ QString RttGraphSource::unitName() const
{
return QObject::tr("secs") ;
}
QString RttGraphSource::displayName(int i) const
{
int n=0 ;
for(std::map<std::string, std::list<std::pair<qint64,float> > >::const_iterator it=_points.begin();it!=_points.end();++it,++n)
if(n==i)
return QString::fromUtf8(rsPeers->getPeerName(RsPeerId(it->first)).c_str()) ;
return QString() ;
}
void RttGraphSource::getValues(std::map<std::string,float>& vals) const
{
std::list<RsPeerId> idList;
@ -111,13 +122,14 @@ RttStatisticsGraph::RttStatisticsGraph(QWidget *parent)
src->setCollectionTimeLimit(10*60*1000) ; // 10 mins
src->setCollectionTimePeriod(1000) ; // collect every second
src->setDigits(1) ;
src->start() ;
addSource(src) ;
setTimeScale(2.0f) ; // 1 pixels per second of time.
setScaleParams(2) ;
resetFlags(RSGRAPH_FLAGS_LOG_SCALE_Y) ;
resetFlags(RSGRAPH_FLAGS_PAINT_STYLE_PLAIN) ;
setFlags(RSGRAPH_FLAGS_SHOW_LEGEND) ;
}