Skip to content

Commit

Permalink
update tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Jul 4, 2024
1 parent c281567 commit b70fe3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions agrolib/criteria1DWidget/tabIrrigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TabIrrigation::TabIrrigation()
axisY->setRange(0,8);
axisY->setTickCount(9);

axisYdx->setTitleText("Prec - Irrigation [mm]");
axisYdx->setTitleText("Precipitation - Irrigation [mm]");
axisYdx->setTitleFont(font);
axisYdx->setRange(0,40);
axisYdx->setTickCount(9);
Expand Down Expand Up @@ -241,7 +241,7 @@ void TabIrrigation::tooltipLAI(QPointF point, bool isShow)
QDate xDate(firstYear, 1, 1);
int doy = int(round(point.x())); // start from 0
xDate = xDate.addDays(doy);
m_tooltip->setText(QString("%1 \nLAI %2 ").arg(xDate.toString("yyyy-MM-dd")).arg(point.y(), 0, 'f', 1));
m_tooltip->setText(QString("%1\nLAI: %2 [m2 m-2]").arg(xDate.toString("yyyy-MM-dd")).arg(point.y(), 0, 'f', 1));
m_tooltip->setAnchor(point);
m_tooltip->setZValue(11);
m_tooltip->updateGeometry();
Expand All @@ -262,7 +262,7 @@ void TabIrrigation::tooltipEvapTransp(QPointF point, bool isShow)
QDate xDate(firstYear, 1, 1);
int doy = int(round(point.x()));
xDate = xDate.addDays(doy);
m_tooltip->setText(xDate.toString("yyyy-MM-dd") + "\n" + QString::number(point.y(),'f', 2)+ "mm");
m_tooltip->setText(xDate.toString("yyyy-MM-dd") + "\n" + QString::number(point.y(),'f', 2)+ " mm");
m_tooltip->setAnchor(point);
m_tooltip->setZValue(11);
m_tooltip->updateGeometry();
Expand Down Expand Up @@ -292,11 +292,11 @@ void TabIrrigation::tooltipPrecIrr(bool isShow, int index, QBarSet *barset)
QString valueStr;
if (barset->label() == "Precipitation [mm]")
{
valueStr = QString("%1 \nPrecipitation [mm] %2 ").arg(xDate.toString("yyyy-MM-dd")).arg(barset->at(index), 0, 'f', 1);
valueStr = QString("%1\nPrecipitation: %2 mm").arg(xDate.toString("yyyy-MM-dd")).arg(barset->at(index), 0, 'f', 1);
}
else if (barset->label() == "Irrigation [mm]")
{
valueStr = QString("%1 \nIrrigation [mm] %2 ").arg(xDate.toString("yyyy-MM-dd")).arg(barset->at(index), 0, 'f', 1);
valueStr = QString("%1\nIrrigation: %2 mm").arg(xDate.toString("yyyy-MM-dd")).arg(barset->at(index), 0, 'f', 1);
}

m_tooltip->setText(valueStr);
Expand Down
4 changes: 2 additions & 2 deletions agrolib/criteria1DWidget/tabLAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ void TabLAI::tooltipME(QPointF point, bool state)
{
QDateTime xDate;
xDate.setMSecsSinceEpoch(point.x());
m_tooltip->setText(QString("%1\nEvaporation max.: %2 mm").arg(xDate.date().toString("yyyy-MM-dd")).arg(point.y(), 0, 'f', 1));
m_tooltip->setText(QString("%1\nmax. Evaporation: %2 mm").arg(xDate.date().toString("yyyy-MM-dd")).arg(point.y(), 0, 'f', 1));
m_tooltip->setAnchor(point);
m_tooltip->setZValue(11);
m_tooltip->updateGeometry();
Expand All @@ -251,7 +251,7 @@ void TabLAI::tooltipMaxTranspiration(QPointF point, bool state)
{
QDateTime xDate;
xDate.setMSecsSinceEpoch(point.x());
m_tooltip->setText(QString("%1\nTranspiration max.: %2 mm").arg(xDate.date().toString("yyyy-MM-dd")).arg(point.y(), 0, 'f', 1));
m_tooltip->setText(QString("%1\nmax. Transpiration: %2 mm").arg(xDate.date().toString("yyyy-MM-dd")).arg(point.y(), 0, 'f', 1));
m_tooltip->setAnchor(point);
m_tooltip->setZValue(11);
m_tooltip->updateGeometry();
Expand Down

0 comments on commit b70fe3f

Please sign in to comment.