Skip to content

Commit

Permalink
add province proxygraph
Browse files Browse the repository at this point in the history
  • Loading branch information
AtenaNiaziNasihati committed Feb 24, 2025
1 parent 3c4ee4c commit f313060
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions agrolib/proxyWidget/chartView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void ChartView::tooltipScatterSeries(QPointF point, bool state)
{
double xValue = point.x();
double yValue = point.y();

QString province = QString::fromStdString(_province);
QString key;

if (serie->name() == "Primary")
Expand Down Expand Up @@ -258,7 +258,7 @@ void ChartView::tooltipScatterSeries(QPointF point, bool state)
}
}
}
m_tooltip->setText(QString("%1\n%2 %3 ").arg(key).arg(xValue, 0, 'f', 1).arg(yValue, 0, 'f', 3));
m_tooltip->setText(QString("%1\n%2 %3\n%4 ").arg(key).arg(xValue, 0, 'f', 1).arg(yValue, 0, 'f', 3).arg(province));
m_tooltip->setSeries(serie);
m_tooltip->setAnchor(point);
m_tooltip->setZValue(11);
Expand Down
3 changes: 2 additions & 1 deletion agrolib/proxyWidget/chartView.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ChartView : public QChartView
void drawModelLapseRate(QList<QPointF> pointList);
void tooltipScatterSeries(QPointF point, bool state);
void setIdPointMap(const QMap<QString, QPointF> &valuePrimary, const QMap<QString, QPointF> &valueSecondary, const QMap<QString, QPointF> &valueSupplemental, const QMap<QString, QPointF> &valueMarked);

void setProvince(const std::string &province);
private:
QScatterSeries *series1;
QScatterSeries *series2;
Expand All @@ -41,6 +41,7 @@ class ChartView : public QChartView
QMap< QString, QPointF > idPointMap2;
QMap< QString, QPointF > idPointMap3;
QMap< QString, QPointF > idPointMapMarked;
QMap< QString, QPointF > _province;
};

#endif // CHARTVIEW_H

0 comments on commit f313060

Please sign in to comment.