1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
This commit is contained in:
Laserlicht 2024-08-25 00:43:55 +02:00
parent 62790e9aad
commit 95d2fbc9b7

View File

@ -466,7 +466,7 @@ LineChart::LineChart(Rect position, std::string title, TData data, TIcons icons,
int dayGridInterval = maxDay < 700 ? 7 : 28; int dayGridInterval = maxDay < 700 ? 7 : 28;
for(const auto & line : data) for(const auto & line : data)
{ {
for(int i = 0; i + dayGridInterval - 1 < line.second.size(); i += dayGridInterval) for(int i = 0; i < line.second.size(); i += dayGridInterval)
{ {
Point p = getPoint(i, line.second) + chartArea.topLeft(); Point p = getPoint(i, line.second) + chartArea.topLeft();
canvas->addLine(Point(p.x, chartArea.topLeft().y), Point(p.x, chartArea.topLeft().y + chartArea.h), ColorRGBA(70, 70, 70)); canvas->addLine(Point(p.x, chartArea.topLeft().y), Point(p.x, chartArea.topLeft().y + chartArea.h), ColorRGBA(70, 70, 70));