Visual module

class Visual.VisualController(vendors, settings, tab_widget, visual_ui)

Bases: object

Controls the Visual tab

Parameters

visual_ui (Ui_visual_tab) – The UI for visual_widget.

create_chart(chart_type, data, file_path)

Creates a chart using calculated data and saves the file to the passed file path

customize_chart(chart)

Customizes a chart using query parameters or user specified entries

do_cost_ratio_calculation(report_type, vendor_name)

Calculates and returns data to be used for cost ratio charts

Return type

dict

do_monthly_calculation(report_type, vendor_name)

Calculates and returns data to be used for monthly charts

Return type

dict

do_top_num_calculation(report_type, vendor_name)

Calculates and returns data to be used for top number charts

Return type

dict

do_yearly_calculation(report_type, vendor_name)

Calculates and returns data to be used for yearly charts

Return type

dict

static get_names(report_type, vendor_name)

Returns all available names for a report type and vendor

Return type

list

static get_names_with_cost(report_type, vendor_name, start_year, end_year)

Returns all available names with cost for a report type and vendor

on_calculation_button_clicked()

Invoked when a calculation option is selected

on_create_chart_clicked()

Invoked when the create chart button is clicked

on_database_updated()
on_report_parameter_changed(report_type)

Invoke when report type is changed

on_vendor_parameter_changed(vendor_name)

Invoked when vendor is changed

on_vendors_changed(vendors)

Handles the signal emitted when the system’s vendor list is updated

Parameters

vendors (list) – An updated list of the system’s vendors

populate_cost_ratio_chart(data, worksheet, bold_format, currency_format, ratio_format)

Populates a worksheet with cost ratio data

Return type

(<class ‘int’>, <class ‘int’>, <class ‘int’>)

populate_monthly_chart(data, worksheet, bold_format)

Populates a worksheet with monthly data

Return type

(<class ‘int’>, <class ‘int’>, <class ‘int’>)

populate_top_num_chart(data, worksheet, bold_format)

Populates a worksheet with top number data

Return type

(<class ‘int’>, <class ‘int’>, <class ‘int’>)

populate_yearly_chart(data, worksheet, bold_format)

Populates a worksheet with yearly data

Return type

(<class ‘int’>, <class ‘int’>, <class ‘int’>)

update_metric_type_combo_box(report_type)

Updates the available metric types for the selected report type

update_name_combo_box()

Updates the name combo box with available names for the selected report type and vendor

update_name_label(report_type)

Updates the name label to match the report type

update_option_views()

Updates the available option selectors for the active calculation type