diff --git a/Graphs/gBarChart.cpp b/Graphs/gBarChart.cpp index 8c7f405e..d60abbb6 100644 --- a/Graphs/gBarChart.cpp +++ b/Graphs/gBarChart.cpp @@ -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;jadd(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); diff --git a/SleepLib/machine.cpp b/SleepLib/machine.cpp index 0eddc33a..36ef2120 100644 --- a/SleepLib/machine.cpp +++ b/SleepLib/machine.cpp @@ -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"),