@@ -165,10 +165,15 @@ struct ValuesInterval {
struct BaseGraphWindow : Window {
protected:
static const int GRAPH_MAX_DATASETS = 64;
static const int GRAPH_BASE_COLOUR = GREY_SCALE(2);
static const int GRAPH_GRID_COLOUR = GREY_SCALE(3);
static const int GRAPH_AXIS_LINE_COLOUR = GREY_SCALE(1);
static const int GRAPH_ZERO_LINE_COLOUR = GREY_SCALE(8);
static const int GRAPH_YEAR_LINE_COLOUR = GREY_SCALE(5);
static const int GRAPH_NUM_MONTHS = 24; ///< Number of months displayed in the graph.
static const TextColour GRAPH_AXIS_LABEL_COLOUR = TC_BLACK; ///< colour of the graph axis label.
static const int MIN_GRAPH_NUM_LINES_Y = 9; ///< Minimal number of horizontal lines to draw.
static const int MIN_GRID_PIXEL_SIZE = 20; ///< Minimum distance between graph lines.
@@ -176,7 +181,6 @@ protected:
byte num_dataset;
byte num_on_x_axis;
byte num_vert_lines;
static const TextColour graph_axis_label_colour = TC_BLACK; ///< colour of the graph axis label.
/* The starting month and year that values are plotted against. If month is
* 0xFF, use x_values_start and x_values_increment below instead. */
@@ -293,12 +297,10 @@ protected:
static_assert(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_COMPANIES);
assert(this->num_vert_lines > 0);
byte grid_colour = GREY_SCALE(3);
/* Rect r will be adjusted to contain just the graph, with labels being
* placed outside the area. */
r.top += 5 + GetCharacterHeight(FS_SMALL) / 2;
r.bottom -= (this->month == 0xFF ? 1 : 3) * GetCharacterHeight(FS_SMALL) + 4;
r.bottom -= (this->month == 0xFF ? 1 : 2) * GetCharacterHeight(FS_SMALL) + 4;
r.left += 9;
r.right -= 5;
@@ -327,7 +329,7 @@ protected:
x_axis_offset = (int)((r.bottom - r.top) * (double)interval.highest / (double)interval_size);
/* Draw the background of the graph itself. */
GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(2));
GfxFillRect(r.left, r.top, r.right, r.bottom, GRAPH_BASE_COLOUR);
/* Draw the vertical grid lines. */
@@ -335,7 +337,7 @@ protected:
x = r.left + x_sep;
for (int i = 0; i < this->num_vert_lines; i++) {
GfxFillRect(x, r.top, x, r.bottom, grid_colour);
GfxFillRect(x, r.top, x, r.bottom, GRAPH_GRID_COLOUR);
x += x_sep;
}
@@ -344,7 +346,7 @@ protected:
for (int i = 0; i < (num_hori_lines + 1); i++) {
GfxFillRect(r.left - 3, y, r.left - 1, y, GRAPH_AXIS_LINE_COLOUR);
GfxFillRect(r.left, y, r.right, y, grid_colour);
GfxFillRect(r.left, y, r.right, y, GRAPH_GRID_COLOUR);
y -= y_sep;
@@ -370,13 +372,13 @@ protected:
SetDParam(0, this->format_str_y_axis);
SetDParam(1, y_label);
DrawString(r.left - label_width - 4, r.left - 4, y, STR_GRAPH_Y_LABEL, graph_axis_label_colour, SA_RIGHT);
DrawString(r.left - label_width - 4, r.left - 4, y, STR_GRAPH_Y_LABEL, GRAPH_AXIS_LABEL_COLOUR, SA_RIGHT);
y_label -= y_label_separation;
y += y_sep;
/* draw strings on the x axis */
/* Draw x-axis labels and markings for graphs based on financial quarters and years. */
if (this->month != 0xFF) {
x = r.left;
y = r.bottom + 2;
@@ -384,26 +386,28 @@ protected:
Year year = this->year;
for (int i = 0; i < this->num_on_x_axis; i++) {
SetDParam(0, month + STR_MONTH_ABBREV_JAN);
SetDParam(1, month + STR_MONTH_ABBREV_JAN + 2);
SetDParam(2, 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);
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;
if (month >= 12) {
month = 0;
year++;
/* Draw a lighter grid line between years. Top and bottom adjustments ensure we don't draw over top and bottom horizontal grid lines. */
GfxFillRect(x + x_sep, r.top + 1, x + x_sep, r.bottom - 1, GRAPH_YEAR_LINE_COLOUR);
} else {
/* Draw the label under the data point rather than on the grid line. */
/* Draw x-axis labels for graphs not based on quarterly performance (cargo payment rates). */
uint16 label = this->x_values_start;
SetDParam(0, label);
DrawString(x + 1, x + x_sep - 1, y, STR_GRAPH_Y_LABEL_NUMBER, graph_axis_label_colour, SA_HOR_CENTER);
DrawString(x + 1, x + x_sep - 1, y, STR_GRAPH_Y_LABEL_NUMBER, GRAPH_AXIS_LABEL_COLOUR, SA_HOR_CENTER);
label += this->x_values_increment;
@@ -493,13 +497,13 @@ public:
uint x_label_width = 0;
byte month = this->month;
x_label_width = std::max(x_label_width, GetStringBoundingBox(month == 0 ? STR_GRAPH_X_LABEL_MONTH_YEAR : STR_GRAPH_X_LABEL_MONTH).width);
@@ -509,7 +513,7 @@ public:
SetDParamMaxValue(0, this->x_values_start + this->num_on_x_axis * this->x_values_increment, 0, FS_SMALL);
x_label_width = GetStringBoundingBox(STR_GRAPH_Y_LABEL_NUMBER).width;
@@ -569,8 +569,8 @@ STR_MONTH_DEC
# Graph window
STR_GRAPH_KEY_BUTTON :{BLACK}Sleutel
STR_GRAPH_KEY_TOOLTIP :{BLACK}Wys sleutel van grafieke
STR_GRAPH_X_LABEL_MONTH :{TINY_FONT}{STRING}{} {STRING}
STR_GRAPH_X_LABEL_MONTH_YEAR :{TINY_FONT}{STRING}{} {STRING}{}{NUM}
STR_GRAPH_X_LABEL_MONTH :{TINY_FONT}{STRING}
STR_GRAPH_X_LABEL_MONTH_YEAR :{TINY_FONT}{STRING}{}{NUM}
STR_GRAPH_Y_LABEL :{TINY_FONT}{STRING}
STR_GRAPH_Y_LABEL_NUMBER :{TINY_FONT}{COMMA}
@@ -538,8 +538,8 @@ STR_MONTH_DEC :ديسمبر
STR_GRAPH_KEY_BUTTON :{BLACK}مفتاح
STR_GRAPH_KEY_TOOLTIP :{BLACK}اظهار مفتاح الرسم البياني
@@ -555,8 +555,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Giltza
STR_GRAPH_KEY_TOOLTIP :{BLACK}Erakutsi giltza grafikoetan
@@ -878,8 +878,8 @@ STR_MONTH_DEC :Сьнежань
STR_GRAPH_KEY_BUTTON :{BLACK}Леґенда
STR_GRAPH_KEY_TOOLTIP :{BLACK}Паказаць леґенду да ґрафікаў
STR_GRAPH_KEY_BUTTON :{BLACK}Chave
STR_GRAPH_KEY_TOOLTIP :{BLACK}Exibir chave aos gráficos
STR_GRAPH_X_LABEL_MONTH_YEAR :{TINY_FONT}{STRING}{} {STRING}{} {NUM}
@@ -561,8 +561,8 @@ STR_MONTH_DEC :Декември
STR_GRAPH_KEY_BUTTON :{BLACK}Легенда
STR_GRAPH_KEY_TOOLTIP :{BLACK}Покажи легендата на графиката
@@ -577,8 +577,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Llegenda
STR_GRAPH_KEY_TOOLTIP :{BLACK}Mostra la llegenda dels gràfics
@@ -664,8 +664,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Ključ
STR_GRAPH_KEY_TOOLTIP :{BLACK}Pokaži ključeve na grafikonima
@@ -655,8 +655,8 @@ STR_MONTH_DEC.gen
STR_GRAPH_KEY_BUTTON :{BLACK}Legenda
STR_GRAPH_KEY_TOOLTIP :{BLACK}Zobrazit legendu ke grafům
@@ -568,8 +568,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Nøgle
STR_GRAPH_KEY_TOOLTIP :{BLACK}Vis nøglen til grafer
@@ -576,8 +576,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_TOOLTIP :{BLACK}Legenda bij deze grafiek weergeven
STR_GRAPH_KEY_BUTTON :{BLACK}Key
STR_GRAPH_KEY_TOOLTIP :{BLACK}Show key to graphs
STR_GRAPH_Y_LABEL :{TINY_FONT}{STRING2}
@@ -550,8 +550,8 @@ STR_MONTH_DEC
@@ -553,8 +553,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Ŝlosilo
STR_GRAPH_KEY_TOOLTIP :{BLACK}Montru ŝlosilon al grafikoj
@@ -633,8 +633,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Selgitus
STR_GRAPH_KEY_TOOLTIP :{BLACK}Näita selgitust graafikute juures
@@ -538,8 +538,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Lykil
STR_GRAPH_KEY_TOOLTIP :{BLACK}Vís lykil til graf
STR_GRAPH_KEY_BUTTON :{BLACK}Selite
STR_GRAPH_KEY_TOOLTIP :{BLACK}Näytä kuvaajan selite
@@ -577,8 +577,8 @@ STR_MONTH_DEC :Décembre
STR_GRAPH_KEY_BUTTON :{BLACK}Légende
STR_GRAPH_KEY_TOOLTIP :{BLACK}Afficher la légende
@@ -758,8 +758,8 @@ STR_MONTH_DEC.dat :Dùbhlachd
STR_GRAPH_KEY_BUTTON :{BLACK}Iuchair
STR_GRAPH_KEY_TOOLTIP :{BLACK}Seall iuchair nan graf
STR_GRAPH_KEY_BUTTON :{BLACK}Lenda
STR_GRAPH_KEY_TOOLTIP :{BLACK}Amosa-la lenda das gráficas
STR_GRAPH_KEY_BUTTON :{BLACK}Legende
STR_GRAPH_KEY_TOOLTIP :{BLACK}Legende des Diagramms anzeigen
@@ -670,8 +670,8 @@ STR_MONTH_DEC :Δεκέμβριος
STR_GRAPH_KEY_BUTTON :{BLACK}Υπόμνημα
STR_GRAPH_KEY_TOOLTIP :{BLACK}Εμφάνιση υπομνήματος στα γραφήματα
@@ -574,8 +574,8 @@ STR_MONTH_DEC :דצמבר
STR_GRAPH_KEY_BUTTON :{BLACK}
STR_GRAPH_KEY_TOOLTIP :{BLACK}הצג מפתחות לגרפים
@@ -631,8 +631,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Jelkulcs
STR_GRAPH_KEY_TOOLTIP :{BLACK}A grafikonok jelmagyarázata
@@ -537,8 +537,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Lykill
STR_GRAPH_KEY_TOOLTIP :{BLACK}Sýna lykilmynd
STR_GRAPH_KEY_BUTTON :{BLACK}Item
STR_GRAPH_KEY_TOOLTIP :{BLACK}Tampilkan grafik item
@@ -559,8 +559,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Eochair
STR_GRAPH_KEY_TOOLTIP :{BLACK}Taispeáin eochair na ngraf
@@ -570,8 +570,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_TOOLTIP :{BLACK}Mostra la legenda del grafico
@@ -577,8 +577,8 @@ STR_MONTH_DEC :{G=m}12월
STR_GRAPH_KEY_BUTTON :{BLACK}범례
STR_GRAPH_KEY_TOOLTIP :{BLACK}그래프의 범례를 보여줍니다.
@@ -750,8 +750,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Clavis
STR_GRAPH_KEY_TOOLTIP :{BLACK}Monstrare formularum clavem
@@ -578,8 +578,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Apzīmējumu atslēga
STR_GRAPH_KEY_TOOLTIP :{BLACK}Diagrammās rādīt apzīmējumu atslēgas
@@ -755,8 +755,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Spalva
STR_GRAPH_KEY_TOOLTIP :{BLACK}Rodo žaidėjų spalvas
STR_GRAPH_KEY_BUTTON :{BLACK}Legend
STR_GRAPH_KEY_TOOLTIP :{BLACK}Weis d'Legend vun der Grafik
@@ -541,8 +541,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Kunci
STR_GRAPH_KEY_TOOLTIP :{BLACK}Tunjukkan kunci kepada graf
STR_GRAPH_KEY_BUTTON :{BLACK}Nøkkel
STR_GRAPH_KEY_TOOLTIP :{BLACK}Vis nøkkel for grafene
@@ -561,8 +561,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_TOOLTIP :{BLACK}Syne nøkkel til grafer
@@ -955,8 +955,8 @@ STR_MONTH_DEC :Grudzień
STR_GRAPH_KEY_TOOLTIP :{BLACK}Pokaż legendę na wykresie
@@ -571,8 +571,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_TOOLTIP :{BLACK}Mostrar chave dos gráficos
@@ -563,8 +563,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Legendă
STR_GRAPH_KEY_TOOLTIP :{BLACK}Afişează legenda graficelor
@@ -714,8 +714,8 @@ STR_MONTH_DEC :Декабрь
STR_GRAPH_KEY_TOOLTIP :{BLACK}Показать легенду к графикам
@@ -747,8 +747,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_TOOLTIP :{BLACK}Prikaži legendu
@@ -568,8 +568,8 @@ STR_MONTH_DEC :12月
STR_GRAPH_KEY_BUTTON :{BLACK}索引
STR_GRAPH_KEY_TOOLTIP :{BLACK}显示图表的公司索引
@@ -640,8 +640,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_BUTTON :{BLACK}Vyb.
STR_GRAPH_KEY_TOOLTIP :{BLACK}Vybrať položky na grafe
@@ -712,8 +712,8 @@ STR_MONTH_DEC
STR_GRAPH_KEY_TOOLTIP :{BLACK}Prikaži ključe grafov
STR_GRAPH_KEY_BUTTON :{BLACK}Leyenda
STR_GRAPH_KEY_TOOLTIP :{BLACK}Mostrar leyenda en gráficos
STR_GRAPH_KEY_TOOLTIP :{BLACK}Mostrar leyenda de gráficas
STR_GRAPH_KEY_BUTTON :{BLACK}Nyckel
STR_GRAPH_KEY_TOOLTIP :{BLACK}Visa nyckel till grafer
@@ -560,8 +560,8 @@ STR_MONTH_DEC :டிசம்பர்
STR_GRAPH_KEY_BUTTON :{BLACK}பட விளக்கக் குறிப்பு
STR_GRAPH_KEY_TOOLTIP :{BLACK}பட விளக்கக் குறிப்பு காண்பி
@@ -551,8 +551,8 @@ STR_MONTH_DEC :ธันวาคม
STR_GRAPH_KEY_BUTTON :{BLACK}ตัวเลือก
STR_GRAPH_KEY_TOOLTIP :{BLACK}แสดงตัวเลือกกราฟ
@@ -560,8 +560,8 @@ STR_MONTH_DEC :十二月
STR_GRAPH_KEY_BUTTON :{BLACK}圖例
STR_GRAPH_KEY_TOOLTIP :{BLACK}顯示圖例
@@ -569,8 +569,8 @@ STR_MONTH_DEC :Aralık
STR_GRAPH_KEY_BUTTON :{BLACK}Anahtar
STR_GRAPH_KEY_TOOLTIP :{BLACK}Grafik anahtarını göster
@@ -696,8 +696,8 @@ STR_MONTH_DEC :Грудень
STR_GRAPH_KEY_TOOLTIP :{BLACK}Показати легенду графіка
@@ -358,8 +358,8 @@ STR_MONTH_DEC :Раштав
STR_GRAPH_KEY_BUTTON :{BLACK}Уҫӑ
STR_GRAPH_KEY_BUTTON :{BLACK}Kaai
STR_GRAPH_KEY_TOOLTIP :{BLACK}Lit kaai foar grafyk sjen
@@ -349,8 +349,8 @@ STR_GRAPH_MENU_DELIVERED_CARGO_GRAPH
############ range for months ends
@@ -532,8 +532,8 @@ STR_MONTH_DEC :декември
STR_GRAPH_KEY_BUTTON :{BLACK}Клучни
STR_GRAPH_KEY_TOOLTIP :{BLACK}Прикажи клуч за графикони
@@ -318,8 +318,8 @@ STR_FILE_MENU_SEPARATOR
@@ -522,8 +522,8 @@ STR_MONTH_DEC :डिसेंबर
STR_GRAPH_KEY_BUTTON :{BLACK}किल्ली
STR_GRAPH_KEY_TOOLTIP :{BLACK}आलेख दर्शवा की
@@ -551,8 +551,8 @@ STR_MONTH_DEC :دسامبر
STR_GRAPH_KEY_BUTTON :{BLACK}کلید
STR_GRAPH_KEY_TOOLTIP :{BLACK}نمایش راهنمای نمودار
@@ -541,8 +541,8 @@ STR_MONTH_DEC :دسمبر
STR_GRAPH_KEY_BUTTON :{BLACK} کلید
STR_GRAPH_KEY_TOOLTIP :{BLACK}مخطط کی کلیدیں دکھائیں
@@ -568,8 +568,8 @@ STR_MONTH_DEC :Tháng Mười Hai
STR_GRAPH_KEY_BUTTON :{BLACK}Nút
STR_GRAPH_KEY_TOOLTIP :{BLACK}Hiện khóa trên biểu đồ
STR_GRAPH_KEY_BUTTON :{BLACK}Allwedd
STR_GRAPH_KEY_TOOLTIP :{BLACK}Dangos allwedd i'r graffiau
Status change: