# graph_gui.cpp File Reference

GUI that shows performance graphs. More...

`#include "stdafx.h"`
`#include "openttd.h"`
`#include "gui.h"`
`#include "window_gui.h"`
`#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_func.h"`
`#include "gfx_func.h"`
`#include "sortlist_type.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Data Structures
struct | GraphLegendWindow
struct | BaseGraphWindow
struct | OperatingProfitGraphWindow
struct | IncomeGraphWindow
struct | DeliveredCargoGraphWindow
struct | PerformanceHistoryGraphWindow
struct | CompanyValueGraphWindow
struct | PaymentRatesGraphWindow
class | CompanyLeagueWindow
struct | PerformanceRatingDetailWindow
## Functions
static void | ShowGraphLegend ()
void | ShowOperatingProfitGraph ()
void | ShowIncomeGraph ()
void | ShowDeliveredCargoGraph ()
void | ShowPerformanceHistoryGraph ()
void | ShowCompanyValueGraph ()
void | ShowCargoPaymentRates ()
static StringID | GetPerformanceTitleFromValue (uint value)
void | ShowCompanyLeagueTable ()
void | ShowPerformanceRatingDetail ()
## Variables
static uint | _legend_excluded_companies
static uint | _legend_excluded_cargo
static const OverflowSafeInt64 | INVALID_DATAPOINT (INT64_MAX)
static const uint | INVALID_DATAPOINT_POS = UINT_MAX
static const Widget | _graph_legend_widgets []
static const WindowDesc | _graph_legend_desc (WDP_AUTO, WDP_AUTO, 250, 198, 250, 198, WC_GRAPH_LEGEND, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET, _graph_legend_widgets)
static const Widget | _operating_profit_widgets []
static const WindowDesc | _operating_profit_desc (WDP_AUTO, WDP_AUTO, 576, 174, 576, 174, WC_OPERATING_PROFIT, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS, _operating_profit_widgets)
static const Widget | _income_graph_widgets []
static const WindowDesc | _income_graph_desc (WDP_AUTO, WDP_AUTO, 576, 142, 576, 142, WC_INCOME_GRAPH, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS, _income_graph_widgets)
static const Widget | _delivered_cargo_graph_widgets []
static const WindowDesc | _delivered_cargo_graph_desc (WDP_AUTO, WDP_AUTO, 576, 142, 576, 142, WC_DELIVERED_CARGO, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS, _delivered_cargo_graph_widgets)
static const Widget | _performance_history_widgets []
static const WindowDesc | _performance_history_desc (WDP_AUTO, WDP_AUTO, 576, 238, 576, 238, WC_PERFORMANCE_HISTORY, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS, _performance_history_widgets)
static const Widget | _company_value_graph_widgets []
static const WindowDesc | _company_value_graph_desc (WDP_AUTO, WDP_AUTO, 576, 238, 576, 238, WC_COMPANY_VALUE, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS, _company_value_graph_widgets)
static const Widget | _cargo_payment_rates_widgets []
static const WindowDesc | _cargo_payment_rates_desc (WDP_AUTO, WDP_AUTO, 568, 46, 568, 46, WC_PAYMENT_RATES, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET, _cargo_payment_rates_widgets)
static const StringID | _performance_titles []
static const Widget | _company_league_widgets []
static const WindowDesc | _company_league_desc (WDP_AUTO, WDP_AUTO, 400, 167, 400, 167, WC_COMPANY_LEAGUE, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_STICKY_BUTTON, _company_league_widgets)
static const Widget | _performance_rating_detail_widgets []
static const WindowDesc | _performance_rating_detail_desc (WDP_AUTO, WDP_AUTO, 299, 241, 299, 241, WC_PERFORMANCE_DETAIL, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET, _performance_rating_detail_widgets)

## Detailed Description

GUI that shows performance graphs.

Definition in file graph_gui.cpp.

## Variable Documentation

const Widget _cargo_payment_rates_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                     STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   567,     0,    13, STR_7061_CARGO_PAYMENT_RATES, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL, RESIZE_BOTTOM,  COLOUR_GREY,     0,   567,    14,    45, 0x0,                          STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 716 of file graph_gui.cpp.

const Widget _company_league_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX, RESIZE_NONE,  COLOUR_GREY,   0,  10,  0,  13, STR_00C5,                      STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION, RESIZE_NONE,  COLOUR_GREY,  11, 387,  0,  13, STR_7053_COMPANY_LEAGUE_TABLE, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {  WWT_STICKYBOX, RESIZE_NONE,  COLOUR_GREY, 388, 399,  0,  13, STR_NULL,                      STR_STICKY_BUTTON},
    {      WWT_PANEL, RESIZE_NONE,  COLOUR_GREY,   0, 399, 14, 166, 0x0,                           STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 838 of file graph_gui.cpp.

const Widget _company_value_graph_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7052_COMPANY_VALUES, STR_018C_WINDOW_TITLE_DRAG_THIS},
    { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,            STR_704D_SHOW_KEY_TO_GRAPHS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   237, 0x0,                     STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 591 of file graph_gui.cpp.

const Widget _delivered_cargo_graph_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                          STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7050_UNITS_OF_CARGO_DELIVERED, STR_018C_WINDOW_TITLE_DRAG_THIS},
    { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,                      STR_704D_SHOW_KEY_TO_GRAPHS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   141, 0x0,                               STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 510 of file graph_gui.cpp.

const Widget _graph_legend_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   249,     0,    13, STR_704E_KEY_TO_COMPANY_GRAPHS, STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   249,    14,   195, 0x0,                            STR_NULL},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    16,    27, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    28,    39, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    40,    51, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    52,    63, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    64,    75, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    76,    87, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    88,    99, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   100,   111, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   112,   123, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   124,   135, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   136,   147, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   148,   159, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   160,   171, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   172,   183, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   184,   195, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
    {   WIDGETS_END},
    }

Definition at line 79 of file graph_gui.cpp.

const Widget _income_graph_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7022_INCOME_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
    { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,          STR_704D_SHOW_KEY_TO_GRAPHS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   141, 0x0,                   STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 473 of file graph_gui.cpp.

const Widget _operating_profit_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7025_OPERATING_PROFIT_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
    { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,                    STR_704D_SHOW_KEY_TO_GRAPHS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   173, 0x0,                             STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 434 of file graph_gui.cpp.

const Widget _performance_history_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                             STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   475,     0,    13, STR_7051_COMPANY_PERFORMANCE_RATINGS, STR_018C_WINDOW_TITLE_DRAG_THIS},
    { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,                         STR_704D_SHOW_KEY_TO_GRAPHS},
    { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   476,   525,     0,    13, STR_PERFORMANCE_DETAIL_KEY,           STR_SHOW_DETAILED_PERFORMANCE_RATINGS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   237, 0x0,                                  STR_NULL},
    {   WIDGETS_END},
    }

Definition at line 553 of file graph_gui.cpp.

const StringID _performance_titles[]`[static]`

Initial value:

     {
      STR_7066_ENGINEER,
      STR_7066_ENGINEER,
      STR_7067_TRAFFIC_MANAGER,
      STR_7067_TRAFFIC_MANAGER,
      STR_7068_TRANSPORT_COORDINATOR,
      STR_7068_TRANSPORT_COORDINATOR,
      STR_7069_ROUTE_SUPERVISOR,
      STR_7069_ROUTE_SUPERVISOR,
      STR_706A_DIRECTOR,
      STR_706A_DIRECTOR,
      STR_706B_CHIEF_EXECUTIVE,
      STR_706B_CHIEF_EXECUTIVE,
      STR_706C_CHAIRMAN,
      STR_706C_CHAIRMAN,
      STR_706D_PRESIDENT,
      STR_706E_TYCOON,
    }

Definition at line 740 of file graph_gui.cpp.