|
@@ -13,12 +13,13 @@
|
|
|
#include "company_base.h"
|
|
|
#include "company_gui.h"
|
|
|
#include "economy_func.h"
|
|
|
#include "cargotype.h"
|
|
|
#include "strings_func.h"
|
|
|
#include "window_func.h"
|
|
|
#include "date_type.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
#include "gfx_func.h"
|
|
|
#include "core/geometry_func.hpp"
|
|
|
#include "currency.h"
|
|
|
#include "timer/timer.h"
|
|
|
#include "timer/timer_window.h"
|
|
@@ -182,13 +183,13 @@ protected:
|
|
|
byte num_dataset;
|
|
|
byte num_on_x_axis;
|
|
|
byte num_vert_lines;
|
|
|
|
|
|
/* The starting month and year that values are plotted against. */
|
|
|
byte month;
|
|
|
Year year;
|
|
|
TimerGameCalendar::Year year;
|
|
|
|
|
|
bool draw_dates = true; ///< Should we draw months and years on the time axis?
|
|
|
|
|
|
/* These values are used if the graph is being plotted against values
|
|
|
* rather than the dates specified by month and year. */
|
|
|
uint16 x_values_start;
|
|
@@ -382,13 +383,13 @@ protected:
|
|
|
|
|
|
/* Draw x-axis labels and markings for graphs based on financial quarters and years. */
|
|
|
if (this->draw_dates) {
|
|
|
x = r.left;
|
|
|
y = r.bottom + ScaleGUITrad(2);
|
|
|
byte month = this->month;
|
|
|
Year year = this->year;
|
|
|
TimerGameCalendar::Year year = this->year;
|
|
|
for (int i = 0; i < this->num_on_x_axis; i++) {
|
|
|
SetDParam(0, month + STR_MONTH_ABBREV_JAN);
|
|
|
SetDParam(1, year);
|
|
|
DrawStringMultiLine(x, x + x_sep, y, this->height, month == 0 ? STR_GRAPH_X_LABEL_MONTH_YEAR : STR_GRAPH_X_LABEL_MONTH, GRAPH_AXIS_LABEL_COLOUR, SA_LEFT);
|
|
|
|
|
|
month += 3;
|
|
@@ -499,13 +500,13 @@ public:
|
|
|
|
|
|
uint x_label_width = 0;
|
|
|
|
|
|
/* Draw x-axis labels and markings for graphs based on financial quarters and years. */
|
|
|
if (this->draw_dates) {
|
|
|
byte month = this->month;
|
|
|
Year year = this->year;
|
|
|
TimerGameCalendar::Year year = this->year;
|
|
|
for (int i = 0; i < this->num_on_x_axis; i++) {
|
|
|
SetDParam(0, month + STR_MONTH_ABBREV_JAN);
|
|
|
SetDParam(1, year);
|
|
|
x_label_width = std::max(x_label_width, GetStringBoundingBox(month == 0 ? STR_GRAPH_X_LABEL_MONTH_YEAR : STR_GRAPH_X_LABEL_MONTH).width);
|
|
|
|
|
|
month += 3;
|