SummaryChart Legend

This commit is contained in:
Mark Watkins 2011-09-10 17:18:46 +10:00
parent fc0f4f695d
commit 70c5a18304
2 changed files with 24 additions and 2 deletions

View File

@ -104,7 +104,6 @@ void SummaryChart::SetDay(Day * nullday)
if (m_graphtype==GT_BAR) {
m_miny=0;
}
// m_minx=qint64(QDateTime(m_profile->FirstDay(),QTime(0,0,0),Qt::UTC).toTime_t())*1000L;
m_maxx=qint64(QDateTime(m_profile->LastDay().addDays(1),QTime(0,0,0),Qt::UTC).toTime_t())*1000L;
@ -293,6 +292,29 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
lines->scissor(left,w.flipY(top+height+2),width+1,height+1);
// Draw Ledgend
px=left+width;
py=top+10;
int wid=120;
QString a;
for (int j=0;j<m_colors.size();j++) {
px-=wid;
lines->add(px,py,px+20,py,m_colors[j]);
lines->add(px,py+1,px+20,py+1,m_colors[j]);
a=channel[m_codes[j]].label();
a+=" ";
switch(m_type[j]) {
case ST_WAVG: a+="Avg"; break;
case ST_AVG: a+="Avg"; break;
case ST_90P: a+="90%"; break;
case ST_MIN: a+="Min"; break;
case ST_MAX: a+="Max"; break;
case ST_HOURS: a+="Hours"; break;
default:break;
}
w.renderText(a,px+24,py+5);
}
if (total_days>0) {
float val=total_val/float(total_days);
QString z=m_label+"="+QString::number(val,'f',2)+" days="+QString::number(total_days,'f',0);

View File

@ -113,7 +113,7 @@ void InitMapsWithoutAwesomeInitializerLists()
CPAP_IPAP_High=CPAP_CODES.Get(CT_Graph,QObject::tr("IPAP Low"),QObject::tr("IPAP High"),"IPAPH"),
CPAP_PressureSupport=CPAP_CODES.Get(CT_Graph,QObject::tr("Pressure Support"),QObject::tr("Pressure Support"),"PS"),
CPAP_Snore=CPAP_CODES.Get(CT_Graph,QObject::tr("Snore"),QObject::tr("Snore"),"Snore"),
CPAP_Leak=CPAP_CODES.Get(CT_Graph,QObject::tr("Leak Rate"),QObject::tr("Leak Rate"),"Leak"),
CPAP_Leak=CPAP_CODES.Get(CT_Graph,QObject::tr("Leak Rate"),QObject::tr("Leak"),"Leak"),
CPAP_RespiratoryRate=CPAP_CODES.Get(CT_Graph,QObject::tr("Respiratory Rate"),QObject::tr("Resp. Rate"),"RR"),
CPAP_TidalVolume=CPAP_CODES.Get(CT_Graph,QObject::tr("Tidal Volume"),QObject::tr("Tidal Volume"),"TV"),
CPAP_MinuteVentilation=CPAP_CODES.Get(CT_Graph,QObject::tr("Minute Ventilation"),QObject::tr("Minute Vent."),"MV"),