HorizontalLineDecorator¶
-
class
qf_lib.plotting.decorators.line_decorators.
HorizontalLineDecorator
(y: (<class 'int'>, <class 'float'>, <class 'complex'>, <class 'int'>, <class 'bool'>, <class 'bytes'>, <class 'str'>, <class 'memoryview'>, <class 'numpy.complex256'>, <class 'numpy.float128'>, <class 'numpy.uint64'>, <class 'numpy.int64'>, <class 'numpy.str_'>, <class 'numpy.complex128'>, <class 'numpy.float64'>, <class 'numpy.uint32'>, <class 'numpy.int32'>, <class 'numpy.bytes_'>, <class 'numpy.complex64'>, <class 'numpy.float32'>, <class 'numpy.uint16'>, <class 'numpy.int16'>, <class 'numpy.bool_'>, <class 'numpy.timedelta64'>, <class 'numpy.float16'>, <class 'numpy.uint8'>, <class 'numpy.int8'>, <class 'numpy.object_'>, <class 'numpy.datetime64'>, <class 'numpy.ulonglong'>, <class 'numpy.longlong'>, <class 'numpy.void'>), color: str = 'k', key: str = None, **plot_settings: Any)[source]¶ Bases:
qf_lib.plotting.decorators.chart_decorator.ChartDecorator
,qf_lib.plotting.decorators.simple_legend_item.SimpleLegendItem
A simple decorator that displays a horizontal line.
Constructs a new horizontal line decorator. The
plot_settings
are passed directly to matplotlib’saxhline
. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.axhline for valid settings.When plotting for the web, the
plot_settings
are passed directly to HighChart’s plotLines options.Methods
decorate
(chart)Modifies the axes object taken from the chart (e.g.
decorate_html
(chart, chart_id)Constructs code to decorate an existing web chart.
-
decorate
(chart: Chart) → None[source]¶ Modifies the axes object taken from the chart (e.g. adds legend, draws cone, etc.).
-
decorate_html
(chart: Chart, chart_id: str) → str[source]¶ Constructs code to decorate an existing web chart.
- Parameters
chart (Chart) –
chart_id (str) – A string identifying the specific chart. For the web, the <div> that represents this chart will typically use this as its id.
- Returns
JavaScript code that is called before the underlying chart is initialised. The code can modify the pre-defined options variable.
- Return type
str
-