Show Summary tooltip on empty days

This commit is contained in:
Mark Watkins 2011-09-13 14:52:30 +10:00
parent b82ab18ae6
commit 4560a32920
2 changed files with 6 additions and 9 deletions

View File

@ -375,13 +375,13 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
{
hl_day=zd;
QHash<int,QHash<short,EventDataType> >::iterator d=m_values.find(hl_day);
x+=gYAxis::Margin+gGraphView::titleWidth; //graph->m_marginleft+
int y=event->y()+rtop-15;
QDateTime dt=QDateTime::fromTime_t(hl_day*86400);
if (d!=m_values.end()) {
day=m_days[zd];
x+=gYAxis::Margin+gGraphView::titleWidth; //graph->m_marginleft+
int y=event->y()+rtop-15;
QDateTime dt=QDateTime::fromTime_t(hl_day*86400);
// Day * day=m_days[hl_day];
//EventDataType val;
@ -401,6 +401,9 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
QString z=dt.date().toString(Qt::SystemLocaleShortDate)+"\n"+m_label+"="+val;//+"\nAHI="+QString::number(day->cph(CPAP_AHI));
graph->ToolTip(z,x,y,2200);
return true;
} else {
QString z=dt.date().toString(Qt::SystemLocaleShortDate)+"\nNo Data";
graph->ToolTip(z,x,y,2200);
}
}
return false;

View File

@ -66,12 +66,6 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height)
QString fd,tmpstr;
int divmax,dividx;
int fitmode;
/*if (xx>2*86400000L) { // Day
dividx=0;
divmax=10;
//fitmode=-1;
fd="MMM dd";
} else */
if (xx>=86400000L) { // Day
fd="MMM 00";
dividx=0;