diff --git a/Graphs/gFlagsLine.cpp b/Graphs/gFlagsLine.cpp
index fd579a1d..9b150f77 100644
--- a/Graphs/gFlagsLine.cpp
+++ b/Graphs/gFlagsLine.cpp
@@ -4,10 +4,50 @@
  License: GPL
 *********************************************************************/
 
-#include <math.h>
+#include <cmath>
+#include <vector>
 #include "SleepLib/profiles.h"
 #include "gFlagsLine.h"
 
+gFlagsGroup::gFlagsGroup()
+{
+}
+gFlagsGroup::~gFlagsGroup()
+{
+}
+
+void gFlagsGroup::Plot(gGraphWindow &w, float scrx, float scry)
+{
+    if (!m_visible) return;
+    int start_px=w.GetLeftMargin();
+    int start_py=w.GetBottomMargin();
+    int width=scrx-(w.GetLeftMargin()+w.GetRightMargin())-1;
+    int height=scry-(w.GetTopMargin()+w.GetBottomMargin());
+
+    glColor3f (0.1F, 0.1F, 0.1F);
+    glLineWidth (1);
+    glBegin (GL_LINE_LOOP);
+    glVertex2f (start_px-1, start_py);
+    glVertex2f (start_px-1, start_py+height);
+    glVertex2f (start_px+width,start_py+height);
+    glVertex2f (start_px+width, start_py);
+    glEnd ();
+
+    vector<gFlagsLine *> visible;
+    for (unsigned i=0;i<layers.size();i++) {
+        if (!layers[i]->isEmpty()) {
+            gFlagsLine *f=dynamic_cast<gFlagsLine *>(layers[i]);
+            visible.push_back(f);
+        }
+    }
+    int vis=visible.size();
+    for (unsigned i=0;i<visible.size();i++) {
+        visible[i]->line_num=i;
+        visible[i]->total_lines=vis;
+        visible[i]->Plot(w,scrx,scry);
+    }
+}
+
 
 gFlagsLine::gFlagsLine(gPointData *d,QColor col,QString _label,int _line_num,int _total_lines)
 :gLayer(d),label(_label),line_num(_line_num),total_lines(_total_lines)
@@ -54,19 +94,6 @@ void gFlagsLine::Plot(gGraphWindow & w,float scrx,float scry)
     line_h=line_h;
     float line_top=(start_py+height-line_h)-line_num*line_h;
 
-
-    if ((line_num==total_lines-1)) { // last lines responsibility to draw the bounding box
-
-        glColor3f (0.1F, 0.1F, 0.1F);
-        glLineWidth (1);
-        glBegin (GL_LINE_LOOP);
-        glVertex2f (start_px-1, start_py);
-        glVertex2f (start_px-1, start_py+height);
-        glVertex2f (start_px+width,start_py+height);
-        glVertex2f (start_px+width, start_py);
-        glEnd ();
-    }
-
     // Alternating box color
     QColor *barcol=&col2;
     if (line_num & 1)
@@ -92,7 +119,7 @@ void gFlagsLine::Plot(gGraphWindow & w,float scrx,float scry)
     // Draw text label
     float x,y;
     GetTextExtent(label,x,y);
-    DrawText(w,label,start_px-x-10,scry-(line_top-((line_h/2)-(y/2))+4));
+    DrawText(w,label,start_px-x-10,(scry-line_top)-(line_h/2)+(y/2)); //(line_top-((line_h/2)-(y/2))+4));
     //glColor3ub(0,0,0);
     //w.renderText(start_px-x-10,scry-(line_top+(line_h/2)-(y/2)+3),label);
     float x1,x2;
diff --git a/Graphs/gFlagsLine.h b/Graphs/gFlagsLine.h
index 3a5bf96b..aa488671 100644
--- a/Graphs/gFlagsLine.h
+++ b/Graphs/gFlagsLine.h
@@ -9,8 +9,11 @@
 
 #include "graphlayer.h"
 
+class gFlagsGroup;
+
 class gFlagsLine:public gLayer
 {
+    friend class gFlagsGroup;
     public:
         gFlagsLine(gPointData *d=NULL,QColor col=QColor("black"),QString _label="",int _line_num=0,int _total_lines=0);
         virtual ~gFlagsLine();
@@ -22,5 +25,13 @@ class gFlagsLine:public gLayer
         int line_num,total_lines;
 };
 
+class gFlagsGroup:public gLayerGroup
+{
+public:
+    gFlagsGroup();
+    virtual ~gFlagsGroup();
+
+    virtual void Plot(gGraphWindow &w, float scrx, float scry);
+};
 
 #endif // GFLAGSLINE_H
diff --git a/Graphs/gXAxis.cpp b/Graphs/gXAxis.cpp
index d5554cef..6c61887d 100644
--- a/Graphs/gXAxis.cpp
+++ b/Graphs/gXAxis.cpp
@@ -163,7 +163,7 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
         }
 
         GetTextExtent(fd,x,y);
-        glColor3ub(0,0,0);
+        //glColor3ub(0,0,0);
         if (!show_time) {
             DrawText(w,fd, px+y, scry-(py-(x/2)-8), 90.0);
             //w.renderText(px-(y/2)+2, scry-(py-(x/2)-20), 90.0,fd);
diff --git a/Graphs/gXAxis.h b/Graphs/gXAxis.h
index 24fd51f0..a7bbc323 100644
--- a/Graphs/gXAxis.h
+++ b/Graphs/gXAxis.h
@@ -15,14 +15,14 @@ class gXAxis:public gLayer
         virtual ~gXAxis();
         virtual void Plot(gGraphWindow & w,float scrx,float scry);
         static const int Margin=25; // How much room does this take up. (Bottom margin)
-        void SetShowMinorLines(bool b) { m_show_minor_lines=b; };
-        void SetShowMajorLines(bool b) { m_show_major_lines=b; };
-        bool ShowMinorLines() { return m_show_minor_lines; };
-        bool ShowMajorLines() { return m_show_major_lines; };
-        void SetShowMinorTicks(bool b) { m_show_minor_ticks=b; };
-        void SetShowMajorTicks(bool b) { m_show_major_ticks=b; };
-        bool ShowMinorTicks() { return m_show_minor_ticks; };
-        bool ShowMajorTicks() { return m_show_major_ticks; };
+        void SetShowMinorLines(bool b) { m_show_minor_lines=b; }
+        void SetShowMajorLines(bool b) { m_show_major_lines=b; }
+        bool ShowMinorLines() { return m_show_minor_lines; }
+        bool ShowMajorLines() { return m_show_major_lines; }
+        void SetShowMinorTicks(bool b) { m_show_minor_ticks=b; }
+        void SetShowMajorTicks(bool b) { m_show_major_ticks=b; }
+        bool ShowMinorTicks() { return m_show_minor_ticks; }
+        bool ShowMajorTicks() { return m_show_major_ticks; }
 
     protected:
 //        virtual const wxString & Format(double v) { static wxString t; wxDateTime d; d.Set(v); t=d.Format(wxT("%H:%M")); return t; };
diff --git a/Graphs/glcommon.cpp b/Graphs/glcommon.cpp
index 9eb15044..990dfb70 100644
--- a/Graphs/glcommon.cpp
+++ b/Graphs/glcommon.cpp
@@ -55,7 +55,7 @@ void GetTextExtent(QString text, float & width, float & height, QFont *font)
     width=fm.width(text); //fm.width(text);
     height=fm.xHeight()+2; //fm.ascent();
 }
-void RDrawText(gGraphWindow & wid, QString text, int x, int  y, float angle, QColor color,QFont *font)
+inline void RDrawText(QPainter & painter, QString text, int x, int  y, float angle, QColor color,QFont *font)
 {
     //QFontMetrics fm(*font);
     float w,h;
@@ -70,10 +70,8 @@ void RDrawText(gGraphWindow & wid, QString text, int x, int  y, float angle, QCo
 
 //    glEnable(GL_TEXTURE_2D);
 //    glDisable(GL_DEPTH_TEST);
-    glFinish();
-    QPainter painter(&wid);
     painter.setFont(*font);
-    color=Qt::black;
+    //color=Qt::black;
     painter.setPen(color);
     painter.setBrush(QBrush(color));
     painter.setOpacity(1);
@@ -88,39 +86,49 @@ void RDrawText(gGraphWindow & wid, QString text, int x, int  y, float angle, QCo
         painter.translate(floor(-x),floor(-y));
 
     }
+}
+struct TextBuffer
+{
+    QString text;
+    int x,y;
+    float angle;
+    QColor color;
+    QFont *font;
+    TextBuffer(QString _text, int _x, int  _y, float _angle, QColor _color,QFont *_font) {
+        text=_text; x=_x; y=_y; angle=_angle; color=_color; font=_font;
+    }
+};
+vector<TextBuffer *> TextQue;
+vector<TextBuffer *> TextQueRot;
 
+void DrawTextQueue(gGraphWindow & wid)
+{
+    glFlush();
+    QPainter painter(&wid);
+    for (unsigned i=0;i<TextQue.size();i++) {
+        TextBuffer & t=*TextQue[i];
+        RDrawText(painter,t.text,t.x,t.y,t.angle,t.color,t.font);
+        delete TextQue[i];
+    }
+    // TODO.. Prerotate the 90degree stuff here and keep the matrix for all of these..
+    TextQue.clear();
+    for (unsigned i=0;i<TextQueRot.size();i++) {
+        TextBuffer & t=*TextQueRot[i];
+        RDrawText(painter,t.text,t.x,t.y,t.angle,t.color,t.font);
+        delete TextQueRot[i];
+    }
+    TextQueRot.clear();
     painter.end();
 
     glDisable(GL_TEXTURE_2D);
     glDisable(GL_DEPTH_TEST);
-
-}
-struct TextBuffer
-{
-    gGraphWindow *wid;
-    QString text;
-    int x,y;
-    float angle;
-    QColor *color;
-    QFont *font;
-    TextBuffer(gGraphWindow * _wid, QString _text, int _x, int  _y, float _angle, QColor *_color,QFont *_font) {
-        wid=_wid; text=_text; x=_x; y=_y; angle=_angle; color=_color; font=_font;
-    }
-};
-vector<TextBuffer *> TextQue;
-
-void DrawTextQueue()
-{
-    for (unsigned i=0;i<TextQue.size();i++) {
-        TextBuffer * t=TextQue[i];
-        RDrawText(*t->wid,t->text,t->x,t->y,t->angle,*t->color,t->font);
-        delete TextQue[i];
-    }
-    TextQue.clear();
 }
+// I bet this slows things down craploads..  should probably skip the vector and use a preallocated textbuffer array.
 void DrawText(gGraphWindow & wid, QString text, int x, int  y, float angle, QColor color,QFont *font)
 {
-    TextQue.push_back(new TextBuffer(&wid,text,x,y,angle,&color,font));
+    TextBuffer *b=new TextBuffer(text,x,y,angle,color,font);
+    if (!angle) TextQue.push_back(b);
+    else TextQueRot.push_back(b);
 }
 
 
diff --git a/Graphs/glcommon.h b/Graphs/glcommon.h
index f1637ded..44ce45d0 100644
--- a/Graphs/glcommon.h
+++ b/Graphs/glcommon.h
@@ -27,7 +27,7 @@ extern GLshort *vertex_array[num_vert_arrays];
 class gGraphWindow;
 void GetTextExtent(QString text, float & width, float & height, QFont *font=defaultfont);
 void DrawText(gGraphWindow & wid, QString text, int x, int y, float angle=0, QColor color=QColor("black"),QFont *font=defaultfont);
-void DrawTextQueue();
+void DrawTextQueue(gGraphWindow & wid);
 
 void LinedRoundedRectangle(int x,int y,int w,int h,int radius,int lw,QColor color);
 void RoundedRectangle(int x,int y,int w,int h,int radius,const QColor color);
diff --git a/Graphs/graphdata.cpp b/Graphs/graphdata.cpp
index 5e88e620..83b1ee34 100644
--- a/Graphs/graphdata.cpp
+++ b/Graphs/graphdata.cpp
@@ -29,6 +29,12 @@ void gGraphData::AddLayer(gLayer *g)
 {
     notify_layers.push_back(g);
 }
+bool gGraphData::isEmpty()
+{
+    bool b=((vc==1) && (np[0]==0)) || vc==0;
+    return b;
+}
+
 
 gPointData::gPointData(int mp)
 :gGraphData(mp,gDT_Point)
diff --git a/Graphs/graphdata.h b/Graphs/graphdata.h
index d79c514d..f67969f7 100644
--- a/Graphs/graphdata.h
+++ b/Graphs/graphdata.h
@@ -54,7 +54,8 @@ public:
 
     vector<int> np;
     vector<int> maxsize;
-    const bool & IsReady() { return m_ready; };
+    bool IsReady() { return m_ready; };
+    bool isEmpty();
 
     void AddLayer(gLayer *g);
 protected:
diff --git a/Graphs/graphlayer.cpp b/Graphs/graphlayer.cpp
index acd60ce0..32483463 100644
--- a/Graphs/graphlayer.cpp
+++ b/Graphs/graphlayer.cpp
@@ -59,3 +59,112 @@ void gLayer::SetMaxY(double v) { if (data) data->SetMaxY(v); };
 
 void gLayer::NotifyGraphWindow(gGraphWindow *g) { m_graph.push_back(g); };
 
+bool gLayer::isEmpty() { if (!data) return false; return data->isEmpty(); };
+
+gLayerGroup::gLayerGroup()
+{
+}
+gLayerGroup::~gLayerGroup()
+{
+}
+//void gLayerGroup::DataChanged(gGraphData *src);
+void gLayerGroup::NotifyGraphWindow(gGraphWindow *g)
+{
+    for (unsigned i=0;i<layers.size();i++) {
+        layers[i]->NotifyGraphWindow(g);
+    }
+}
+
+void gLayerGroup::AddLayer(gLayer *l)
+{
+    layers.push_back(l);
+}
+
+double gLayerGroup::MinX()
+{
+    bool first=true;
+    double m=0;
+    for (unsigned i=0;i<layers.size();i++)  {
+        if (first) {
+            m=layers[i]->MinX();
+            first=false;
+        } else
+        if (m>layers[i]->MinX()) m=layers[i]->MinX();
+    }
+    return m;
+}
+double gLayerGroup::MaxX()
+{
+    bool first=true;
+    double m=0;
+    for (unsigned i=0;i<layers.size();i++)  {
+        if (first) {
+            m=layers[i]->MaxX();
+            first=false;
+        } else
+        if (m<layers[i]->MaxX()) m=layers[i]->MaxX();
+    }
+    return m;
+}
+double gLayerGroup::MinY()
+{
+}
+double gLayerGroup::MaxY()
+{
+}
+
+double gLayerGroup::RealMinX()
+{
+    bool first=true;
+    double m=0;
+    for (unsigned i=0;i<layers.size();i++)  {
+        if (first) {
+            m=layers[i]->RealMinX();
+            first=false;
+        } else
+        if (m>layers[i]->RealMinX()) m=layers[i]->RealMinX();
+    }
+    return m;
+}
+double gLayerGroup::RealMaxX()
+{
+    bool first=true;
+    double m=0;
+    for (unsigned i=0;i<layers.size();i++)  {
+        if (first) {
+            m=layers[i]->RealMaxX();
+            first=false;
+        } else
+        if (m>layers[i]->RealMaxX()) m=layers[i]->RealMaxX();
+    }
+    return m;
+}
+double gLayerGroup::RealMinY()
+{
+    return 0;
+}
+double gLayerGroup::RealMaxY()
+{
+    return 0;
+}
+
+void gLayerGroup::SetMinX(double v)
+{
+    for (unsigned i=0;i<layers.size();i++)
+        layers[i]->SetMinX(v);
+}
+void gLayerGroup::SetMaxX(double v)
+{
+    for (unsigned i=0;i<layers.size();i++)
+        layers[i]->SetMaxX(v);
+}
+void gLayerGroup::SetMinY(double v)
+{
+    for (unsigned i=0;i<layers.size();i++)
+        layers[i]->SetMinY(v);
+}
+void gLayerGroup::SetMaxY(double v)
+{
+    for (unsigned i=0;i<layers.size();i++)
+        layers[i]->SetMaxY(v);
+}
diff --git a/Graphs/graphlayer.h b/Graphs/graphlayer.h
index 5a415a8d..f501cba1 100644
--- a/Graphs/graphlayer.h
+++ b/Graphs/graphlayer.h
@@ -44,10 +44,10 @@ public:
     virtual void SetMaxY(double v);
 
 
-    void NotifyGraphWindow(gGraphWindow *g);
-    void SetVisible(bool v) { m_visible=v; };
-    bool IsVisible() { return m_visible; };
-
+    virtual void NotifyGraphWindow(gGraphWindow *g);
+    virtual void SetVisible(bool v) { m_visible=v; };
+    virtual bool IsVisible() { return m_visible; };
+    virtual bool isEmpty();
 protected:
     bool m_visible;
     bool m_movable;
@@ -57,4 +57,34 @@ protected:
 
 };
 
+class gLayerGroup:public gLayer
+{
+public:
+    gLayerGroup();
+    virtual ~gLayerGroup();
+    virtual void AddLayer(gLayer *l);
+
+    //virtual void DataChanged(gGraphData *src);
+    virtual void NotifyGraphWindow(gGraphWindow *g);
+
+    virtual double MinX();
+    virtual double MaxX();
+    virtual double MinY();
+    virtual double MaxY();
+
+    virtual double RealMinX();
+    virtual double RealMaxX();
+    virtual double RealMinY();
+    virtual double RealMaxY();
+
+    virtual void SetMinX(double v);
+    virtual void SetMaxX(double v);
+    virtual void SetMinY(double v);
+    virtual void SetMaxY(double v);
+
+
+protected:
+    vector<gLayer *> layers;
+};
+
 #endif // GRAPHLAYER_H
diff --git a/Graphs/graphwindow.cpp b/Graphs/graphwindow.cpp
index a39b68ae..93eca089 100644
--- a/Graphs/graphwindow.cpp
+++ b/Graphs/graphwindow.cpp
@@ -733,8 +733,7 @@ void gGraphWindow::Render(float w, float h)
     for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
         (*l)->Plot(*this,w,h);
     }
-    glFinish();
-    DrawTextQueue();
+    DrawTextQueue(*this);
 }
 
 void gGraphWindow::paintGL()
diff --git a/SleepLib/loader_plugins/prs1_loader.cpp b/SleepLib/loader_plugins/prs1_loader.cpp
index 1e6c7c32..832b8c5e 100644
--- a/SleepLib/loader_plugins/prs1_loader.cpp
+++ b/SleepLib/loader_plugins/prs1_loader.cpp
@@ -1060,7 +1060,7 @@ void InitModelMap()
 {
     ModelMap[34]="RemStar Pro with C-Flex+";
     ModelMap[35]="RemStar Auto with A-Flex";
-    ModelMap[37]="RemStar BIPAP Auto with Bi-Flex";
+    ModelMap[37]="RemStar BiPAP Auto with Bi-Flex";
     ModelMap[0x41]="BiPAP autoSV Advanced";
 };
 
diff --git a/daily.cpp b/daily.cpp
index 6ed05ed1..d74e53d5 100644
--- a/daily.cpp
+++ b/daily.cpp
@@ -67,25 +67,27 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
     AddCPAPData(flags[9]=new FlagData(CPAP_Snore,1)); // Snore Index
 
     SF=new gGraphWindow(gSplitter,tr("Event Flags"),(QGLWidget *)NULL);
+    fg=new gFlagsGroup();
 
     SF->SetLeftMargin(SF->GetLeftMargin()+gYAxis::Margin);
     SF->SetBlockZoom(true);
     SF->AddLayer(new gXAxis());
 
-    bool extras=false; //true;
     int sfc=7;
+    bool extras=false; //true;
+    fg->AddLayer(new gFlagsLine(flags[0],QColor("light green"),"CSR",0,sfc));
+    fg->AddLayer(new gFlagsLine(flags[1],QColor("purple"),"CA",1,sfc));
+    fg->AddLayer(new gFlagsLine(flags[2],QColor("aqua"),"OA",2,sfc));
+    fg->AddLayer(new gFlagsLine(flags[3],QColor("blue"),"H",3,sfc));
+    fg->AddLayer(new gFlagsLine(flags[4],QColor("black"),"FL",4,sfc));
+    fg->AddLayer(new gFlagsLine(flags[6],QColor("gold"),"RE",6,sfc));
+    fg->AddLayer(new gFlagsLine(flags[5],QColor("red"),"VS",5,sfc));
     if (extras) {
-        sfc+=1;
-        SF->AddLayer(new gFlagsLine(flags[8],QColor("dark green"),"U0E",7,sfc));
-        //SF->AddLayer(new gFlagsLine(flags[8],QColor("red"),"VS2",7,sfc));
+        fg->AddLayer(new gFlagsLine(flags[8],QColor("dark green"),"U0E",7,sfc));
+        fg->AddLayer(new gFlagsLine(flags[9],QColor("red"),"VS2",8,sfc));
+        sfc++;
     }
-    SF->AddLayer(new gFlagsLine(flags[6],QColor("gold"),"RE",6,sfc));
-    SF->AddLayer(new gFlagsLine(flags[5],QColor("red"),"VS",5,sfc));
-    SF->AddLayer(new gFlagsLine(flags[4],QColor("black"),"FL",4,sfc));
-    SF->AddLayer(new gFlagsLine(flags[3],QColor("blue"),"H",3,sfc));
-    SF->AddLayer(new gFlagsLine(flags[2],QColor("aqua"),"OA",2,sfc));
-    SF->AddLayer(new gFlagsLine(flags[1],QColor("purple"),"CA",1,sfc));
-    SF->AddLayer(new gFlagsLine(flags[0],QColor("light green"),"CSR",0,sfc));
+    SF->AddLayer(fg);
     SF->AddLayer(new gFooBar(10,QColor("orange"),QColor("dark grey"),true));
     SF->setMinimumHeight(150+(extras ? 20 : 0));
    // SF->setMaximumHeight(350);
@@ -106,23 +108,23 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
     PRD->AddLayer(new gLineChart(pressure_eap,Qt::red,4096,false,true,square));
     PRD->setMinimumHeight(150);
 
-    AddCPAPData(leakdata=new EventData(CPAP_Leak,0));
+    AddCPAPData(leak=new EventData(CPAP_Leak,0));
     LEAK=new gGraphWindow(gSplitter,tr("Leaks"),SF);
     LEAK->AddLayer(new gXAxis());
     LEAK->AddLayer(new gYAxis());
     //LEAK->AddLayer(new gFooBar());
-    LEAK->AddLayer(new gLineChart(leakdata,QColor("purple"),65536,false,false,true));
+    LEAK->AddLayer(new gLineChart(leak,QColor("purple"),65536,false,false,true));
 
     LEAK->setMinimumHeight(150);
 
 
-    AddCPAPData(mpw=new WaveData(CPAP_MaskPressure,1000000)); //FlowRate
+    AddCPAPData(mp=new WaveData(CPAP_MaskPressure,1000000)); //FlowRate
     MP=new gGraphWindow(gSplitter,tr("Mask Pressure"),SF);
     gYAxis *y=new gYAxis();
     y->SetScale(.1);
     MP->AddLayer(y);
     MP->AddLayer(new gXAxis());
-    gLineChart *g=new gLineChart(mpw,Qt::black,4000,true);
+    gLineChart *g=new gLineChart(mp,Qt::blue,4000,true);
     g->ReportEmpty(true);
     MP->AddLayer(g);
     MP->setMinimumHeight(120);
@@ -698,10 +700,27 @@ void Daily::Load(QDate date)
     // and show based on this factor.
 
     //cpap && cpap->count(CPAP_MinuteVentilation)>0 ? MV->show() : MV->hide();
-    cpap && cpap->count(CPAP_MinuteVentilation)>0 ? MV->show() : MV->hide();
-    cpap && cpap->count(CPAP_TidalVolume)>0 ? TV->show() : TV->hide();
-    cpap && cpap->count(CPAP_RespiratoryRate)>0 ? RR->show() : RR->hide();
-    cpap && cpap->count(CPAP_FlowLimitGraph)>0 ? FLG->show() : FLG->hide();
+    //cpap && cpap->count(CPAP_MinuteVentilation)>0 ? MV->show() : MV->hide();
+    //cpap && cpap->count(CPAP_TidalVolume)>0 ? TV->show() : TV->hide();
+    //cpap && cpap->count(CPAP_RespiratoryRate)>0 ? RR->show() : RR->hide();
+    //cpap && cpap->count(CPAP_FlowLimitGraph)>0 ? FLG->show() : FLG->hide();
+    mv->isEmpty() ? MV->hide() : MV->show();
+    tv->isEmpty() ? TV->hide() : TV->show();
+    rr->isEmpty() ? RR->hide() : RR->show();
+    flg->isEmpty() ? FLG->hide() : FLG->show();
+    mp->isEmpty() ? MP->hide() : MP->show();
+    frw->isEmpty() ? FRW->hide() : FRW->show();
+    prd->isEmpty() && pressure_iap->isEmpty() ? PRD->hide() : PRD->show();
+    leak->isEmpty() ? LEAK->hide() : LEAK->show();
+    snore->isEmpty() ? SNORE->hide() : SNORE->show();
+
+    bool merge_oxi_graphs=true;
+    if (!merge_oxi_graphs) {
+        spo2->isEmpty() ? SPO2->hide() : SPO2->show();
+        pulse->isEmpty() ? PULSE->hide() : PULSE->show();
+    } else {
+        pulse->isEmpty() && spo2->isEmpty() ? PULSE->hide() : PULSE->show();
+    }
 
     if (oxi) {
         html+="<tr><td>"+tr("Pulse:");
@@ -716,10 +735,10 @@ void Daily::Load(QDate date)
 
         //html+=wxT("<tr><td colspan=4>&nbsp;</td></tr>\n");
 
-        PULSE->show();
+        //PULSE->show();
         //SPO2->show();
     } else {
-        PULSE->hide();
+        //PULSE->hide();
         //SPO2->hide();
     }
     if (!cpap && !oxi) {
@@ -952,6 +971,7 @@ void Daily::on_treeWidget_itemSelectionChanged()
         double st=(d.addSecs(-180)).toMSecsSinceEpoch()/86400000.0;
         double et=(d.addSecs(180)).toMSecsSinceEpoch()/86400000.0;
         FRW->SetXBounds(st,et);
+        MP->SetXBounds(st,et);
         SF->SetXBounds(st,et);
         PRD->SetXBounds(st,et);
         LEAK->SetXBounds(st,et);
diff --git a/daily.h b/daily.h
index 43291516..eb1f9905 100644
--- a/daily.h
+++ b/daily.h
@@ -18,7 +18,7 @@
 #include <SleepLib/profiles.h>
 #include <Graphs/graphwindow.h>
 #include <Graphs/graphdata.h>
-
+#include <Graphs/gFlagsLine.h>
 namespace Ui {
     class Daily;
 }
@@ -57,15 +57,17 @@ private:
     void UpdateCalendarDay(QDate date);
     void UpdateEventsTree(QTreeWidget * tree,Day *day);
 
-    gPointData *tap,*tap_eap,*tap_iap,*g_ahi,*frw,*prd,*leakdata,*pressure_iap,*pressure_eap,*snore;
-    gPointData *pulse,*spo2,*rr,*mv,*tv,*mpw,*flg;
+    gPointData *tap,*tap_eap,*tap_iap,*g_ahi,*frw,*prd,*leak,*pressure_iap,*pressure_eap,*snore;
+    gPointData *pulse,*spo2,*rr,*mv,*tv,*mp,*flg;
 
+    gFlagsGroup *fg;
     gGraphWindow *PRD,*FRW,*G_AHI,*TAP,*LEAK,*SF,*TAP_EAP,*TAP_IAP,*PULSE,*SPO2,*SNORE,*RR,*MP,*MV,*TV,*FLG;
 
     list<gPointData *> OXIData;
     list<gPointData *> CPAPData;
     list<gGraphWindow *> Graphs;
 
+
     void AddCPAPData(gPointData *d) { CPAPData.push_back(d); };
     void AddOXIData(gPointData *d) { OXIData.push_back(d); };
     void AddGraph(gGraphWindow *w);