qf_lib.plotting.helpers.create_bar_chart.create_bar_chart(series_list: List[QFSeries], names_list, title: str, lines: List[QFSeries], recession_series: Optional[QFSeries] = None, start_x: Optional[datetime] = None, end_x: Optional[datetime] = None, quarterly: bool = False, date_label_format: Tuple[str, str] = ('%Y', '%y Q{}'), recession_name: Optional[str] = None) BarChart[source]

Creates a new bar chart based on the settings specified.

This function makes some assumptions about the type of bar chart to create, but it should cover >90% of cases.

  • series_list (List[QFSeries]) –

  • names_list

  • title (str) –

  • lines (List[QFSeries]) – One or more series representing the lines to draw on the bar chart.

  • recession_series (QFSeries) – A series that will be used to highlight recession periods using gray boxes.

  • start_x (datetime) – The first date to plot from the specified series.

  • end_x (datetime) – The last date to plot from the specified series.

  • quarterly (bool) – Whether the bar chart should be formatted for quarterly frequency series.

  • date_label_format (Tuple[str, str]) – The format for the date labels in the x-axis. It can contain a format parameter which will be replaced with the quarter. The first format is for labels that are not shown every quarter, whereas the second format is used for labels that are shown on every quarter.

  • recession_name (str) – Example “US Recession”


A new bar chart.

Return type: