Expanded XAxis range.. Too many days were causing the xtickers not to display

This commit is contained in:
Mark Watkins 2011-09-05 21:23:35 +10:00
parent b5d4c1fc79
commit 8fe70da1d0
2 changed files with 14 additions and 8 deletions

View File

@ -271,6 +271,11 @@ void gToolTip::paint() //actually paints it.
rect.setLeft(m_graphview->width()-2-rect.width());//m_pos.x()-m_spacer); rect.setLeft(m_graphview->width()-2-rect.width());//m_pos.x()-m_spacer);
rect.setRight(m_graphview->width()-2); rect.setRight(m_graphview->width()-2);
} }
int h=rect.height();
if (rect.y()<0) {
rect.setY(0);
rect.setHeight(h);
}
painter.drawRoundedRect(rect,5,5); painter.drawRoundedRect(rect,5,5);
painter.drawText(rect,Qt::AlignCenter,m_text); painter.drawText(rect,Qt::AlignCenter,m_text);
@ -1827,6 +1832,7 @@ void gGraphView::wheelEvent(QWheelEvent * event)
} }
} else { } else {
m_scrollbar->SendWheelEvent(event); // Just forwarding the event to scrollbar for now.. m_scrollbar->SendWheelEvent(event); // Just forwarding the event to scrollbar for now..
m_tooltip->cancel();
} }
} }

View File

@ -9,7 +9,7 @@
#include "gXAxis.h" #include "gXAxis.h"
const quint64 divisors[]={ const quint64 divisors[]={
2419200000LL, 1814400000L, 1209600000L, 604800000L, 259200000L, 15552000000LL, 7776000000LL, 5184000000LL, 2419200000L, 1814400000L, 1209600000L, 604800000L, 259200000L,
172800000L, 86400000,2880000,14400000,7200000,3600000,2700000, 172800000L, 86400000,2880000,14400000,7200000,3600000,2700000,
1800000,1200000,900000,600000,300000,120000,60000,45000,30000, 1800000,1200000,900000,600000,300000,120000,60000,45000,30000,
20000,15000,10000,5000,2000,1000,100,50,10 20000,15000,10000,5000,2000,1000,100,50,10
@ -75,22 +75,22 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height)
if (xx>=86400000L) { // Day if (xx>=86400000L) { // Day
fd="MMM 00"; fd="MMM 00";
dividx=0; dividx=0;
divmax=7; divmax=10;
fitmode=0; fitmode=0;
} else if (xx>600000) { // Minutes } else if (xx>600000) { // Minutes
fd="00:00"; fd="00:00";
dividx=7; dividx=10;
divmax=24; divmax=27;
fitmode=1; fitmode=1;
} else if (xx>5000) { // Seconds } else if (xx>5000) { // Seconds
fd="00:00:00"; fd="00:00:00";
dividx=13; dividx=16;
divmax=24; divmax=27;
fitmode=2; fitmode=2;
} else { // Microseconds } else { // Microseconds
fd="00:00:00:000"; fd="00:00:00:000";
dividx=25; dividx=28;
divmax=divcnt-1; divmax=divcnt;
fitmode=3; fitmode=3;
} }
//if (divmax>divcnt) divmax=divcnt; //if (divmax>divcnt) divmax=divcnt;