diff --git a/Graphs/gGraphView.cpp b/Graphs/gGraphView.cpp index 2f1596ea..d81dcc54 100644 --- a/Graphs/gGraphView.cpp +++ b/Graphs/gGraphView.cpp @@ -1050,6 +1050,7 @@ gGraph::gGraph(gGraphView *graphview,QString title,QString units, int height,sho m_selecting_area=m_blockzoom=false; m_lastx23=0; + m_quad=new gVertexBuffer(64,GL_QUADS); m_quad->forceAntiAlias(true); f_miny=f_maxy=0; @@ -1857,49 +1858,67 @@ void gGraph::ToolTip(QString text, int x, int y, int timeout) void gGraph::roundY(EventDataType &miny, EventDataType &maxy) { + if (title()=="Sessions") { + int i=5; + } int m,t; bool ymin_good=false,ymax_good=false; if (rec_miny!=rec_maxy) { - if (miny>rec_miny) miny=rec_miny; - if (maxyrec_miny) + miny=rec_miny; + if (maxy=0 && t<0) t=0; - if (!ymin_good) miny=t; + if (miny==t) + t-=2; + if (miny>=0 && t<0) + t=0; + if (!ymin_good) + miny=t; return; } if (maxy>=400) { m=ceil(maxy/50.0); t=m*50; - if (!ymax_good) maxy=t; + if (!ymax_good) + maxy=t; m=floor(miny/50.0); - if (!ymin_good) miny=m*50; + if (!ymin_good) + miny=m*50; } else if (maxy>=5) { m=ceil(maxy/5.0); t=m*5; - if (!ymax_good) maxy=t; + if (!ymax_good) + maxy=t; m=floor(miny/5.0); - if (!ymin_good) miny=m*5; + if (!ymin_good) + miny=m*5; } else { if (maxy==miny && maxy==0) { maxy=0.5; } else { //maxy*=4.0; //miny*=4.0; - if (!ymax_good) maxy=ceil(maxy); - if (!ymin_good) miny=floor(miny); + if (!ymax_good) + maxy=ceil(maxy); + if (!ymin_good) + miny=floor(miny); //maxy/=4.0; //miny/=4.0; } diff --git a/overview.cpp b/overview.cpp index edc3598d..36443df8 100644 --- a/overview.cpp +++ b/overview.cpp @@ -188,8 +188,6 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : set->addSlice(CPAP_PresReliefSet,QColor("red"),ST_SETWAVG); //set->addSlice(RMS9_EPRSet,QColor("green"),ST_SETWAVG); //set->addSlice(INTP_SmartFlex,QColor("purple"),ST_SETWAVG); - SET->setRecMinY(0); - SET->setRecMaxY(5); SET->AddLayer(set); rr=new SummaryChart(tr("breaths/min"),GT_LINE); @@ -268,6 +266,10 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : ui->rangeCombo->setCurrentIndex(6); icon_on=new QIcon(":/icons/session-on.png"); icon_off=new QIcon(":/icons/session-off.png"); + SES->setRecMinY(1); + SET->setRecMinY(0); + SET->setRecMaxY(5); + } Overview::~Overview() {