create_line_chart¶
-
qf_lib.plotting.helpers.create_line_chart.
create_line_chart
(data_list: List[Union[qf_lib.containers.series.qf_series.QFSeries, qf_lib.plotting.decorators.data_element_decorator.DataElementDecorator]], names_list, title: str = None, recession_series: qf_lib.containers.series.qf_series.QFSeries = None, horizontal_lines_list: List[float] = None, vertical_lines_list: List[float] = None, disable_dot: bool = False, start_x: datetime.datetime = None, end_x: datetime.datetime = None, upper_y: float = None, lower_y: float = None, dot_decimal_points: int = 2, recession_name: str = None) → qf_lib.plotting.charts.line_chart.LineChart[source]¶ Creates a new line chart based on the settings specified.
This function makes certain assumptions about the line chart, it can be customised via the parameters which should cover >90% of use cases. For more customisation use the
LineChart
class directly.- Parameters
data_list (List[Union[QFSeries, DataElementDecorator]]) – A list of
QFSeries
or ``DataElementDecorator``s to plot on the chart.names_list (List[str]) – A list of strings specifying the labels for the series, horizontal and vertical lines respectively.
None
can be specified for labels to not display it for a specific series, or line.title (str) – The title of the graph, specify
None
if you don’t want the chart to show a title.recession_series (QFSeries) – A
QFSeries
specifying where recessions occurred on the chart, will be highlighted using grey rectangles on the graph.horizontal_lines_list (List[float]) – An optional list of values where a horizontal line should be drawn.
vertical_lines_list (List[float]) – An optional list of values where a vertical line should be drawn.
disable_dot (bool) – Whether a marker on the last point should be disabled.
start_x (datetime) – The date where plotting should begin.
end_x (datetime) – The date where plotting should end.
upper_y (float) – The upper bound y-axis value at which plotting should begin.
lower_y (float) – The lower bound y-axis value at which plotting should begin.
dot_decimal_points (int) – How many decimal places to show after the decimal points when drawing text for “dot”.
recession_name (str) – A string specifying the recession label. If “None” or missing, will not be included.
- Returns
The constructed
LineChart
.- Return type