BarChart#
- class qf_lib.plotting.charts.bar_chart.BarChart(orientation: Orientation, stacked: bool = True, index_translator: IndexTranslator = None, thickness: float = 0.8, start_x: Any = None, end_x: Any = None, upper_y: float = None, lower_y: float = None, **plot_settings)[source]#
Bases:
ChartCreates a new bar chart with the specified
orientation.- Parameters:
orientation (Orientation) – The orientation of the bar chart, either Horizontal or Vertical.
stacked (bool) – default: True; if True then bars corresponding to different DataElementDecorators will be stacked. Otherwise bars will be plotted next to each other.
index_translator (IndexTranslator) – the mapper of index coordinates (e.g. you may use labels as index in a pandas series and this translator will ensure that it is plotted correctly)
thickness (float) – how thick should each bar be (expressed in numeric data coordinates system)
start_x (datetime.datetime) – The date where the x-axis should begin.
end_x (datetime.datetime) – The date where the x-axis should end.
upper_y (float) – The upper bound of the y-axis.
lower_y (float) – The lower bound of the y-axis.
plot_settings – Keyword arguments to pass to the
plotfunction.
- apply_data_element_decorators(data_element_decorators: List[DataElementDecorator]) Any[source]#
Plots all DataElementDecorators added to a chart. This function should set legend_artist field in each plotted DataElementDecorator (if applicable).
- Parameters:
data_element_decorators (List[DataElementDecorator]) – non-empty list of DataElementDecorators that should be plotted on the chart