LineChart

class qf_lib.plotting.charts.line_chart.LineChart(start_x: any = None, end_x: any = None, upper_y: any = None, lower_y: any = None, log_scale: bool = False, rotate_x_axis=False)[source]

Bases: qf_lib.plotting.charts.chart.Chart

Simple line chart. It can plot both QFSeries and DataFrames. By default the start_x and end_x will be determined by the series added to the chart. So whatever the earliest data point is will determine the start_x.

Parameters
  • start_x (Any) – if not set to None, the chart x-axis will begin at the specified start_x value

  • end_x (Any) – if not set to None, the chart x-axis will end at the specified end_x value.

  • upper_y (Anny) – the upper bound of the y-axis.

  • lower_y (Anny) – the lower bound of the y-axis.

  • log_scale (bool) – use log scale.

  • rotate_x_axis (bool) – rotate the x-axis.

Methods

apply_data_element_decorators(…)

Plots all DataElementDecorators added to a chart.

plot(figsize, float] = None)

Plots the chart.

apply_data_element_decorators(data_element_decorators: List[DataElementDecorator])[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

plot(figsize: Tuple[float, float] = None) → None[source]

Plots the chart. The underlying figure stays hidden until the show() method is called.

Parameters

figsize (Tuple[float, float]) – The figure size to draw the chart at in inches. This is a tuple of (width, height) passed directly to matplotlib’s plot function. The values are expressed in inches.