time_series_transform.plot package

Submodules

time_series_transform.plot.base module

class time_series_transform.plot.base.plot_base(time_series)[source]

Bases: object

plot_base is the base class for the plot engine, user is able to call the plot function from the transformer or use the create_plot() function

add_line(lineType, col=None, data=None, legendName=None, subplot='y', showlegend=True, color='default', **kwargs)[source]

add_line add line to the current plot

Parameters
  • lineType (str) – type of the line, e.g. “scatter”, “bar”

  • col (str) – name of the column from the time_series_data, either data or col is required

  • data (array) – array of the input data, either data or col is required

  • legendName (str) – string of the legend name, default None

  • subplot (str) – subplot of the line added, default ‘y’ format: ‘y1’, ‘y2’….

  • showlegend (bool, optional) – show the legend, by default True

  • color (str, optional) – color of the line, by default None

add_marker(x, y, color, legendName, showlegend=True, marker='circle', **kwargs)[source]

add_marker will add the marker of the shape on the plot

Parameters
  • x (array) – array of the x coordinates

  • y (array) – array of the y coordinates

  • color (str) – color of the marker

  • legendName (str) – name of the legend

  • showlegend (bool, optional) – show the legend, by default True

  • marker (str, optional) – shape of the marker, by default ‘circle’

Returns

the current TimeSeriesPlot object

Return type

self

get_current_plots()[source]

return a dictionary of the current plots and corresponding lines

Returns

current plots and lines

Return type

dict

remove_line(legendName)[source]

remove the line by the given legendName from the plot

Parameters

legendName (str) – legend name of the line

Raises

ValueError – raise when it is trying to remove the default candle plot

remove_subplot(subplotName)[source]

remove subplot from the plot

Parameters

subplotName (str) – subplot name deleted

Raises

ValueError – raise when the subplot does not exist

show()[source]

show the current plot

update_layout(**kwargs)[source]

update the layout of the plot

Returns

it will return the plot class object with the updated layout

Return type

plot

time_series_transform.plot.stock_plot module

class time_series_transform.plot.stock_plot.StockPlot(stock)[source]

Bases: time_series_transform.plot.base.plot_base

time_series_transform.plot.time_series_plot module

class time_series_transform.plot.time_series_plot.TimeSeriesPlot(time_series_data)[source]

Bases: time_series_transform.plot.base.plot_base

bar(cols, title='')[source]

create the bar chart of the given columns and title

Parameters
  • cols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

Returns

the current TimeSeriesPlot object

Return type

self

create_plot(dataCols, title='', lineType='scatter', **kwargs)[source]

create plot based on the given data columns

Parameters
  • dataCols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

  • lineType (str, optional) – type of the line in the plot, by default ‘scatter’

Returns

the current TimeSeriesPlot object

Return type

self

line(cols, title='')[source]

create the line chart of the given columns and title

Parameters
  • cols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

Returns

the current TimeSeriesPlot object

Return type

self

time_series_transform.plot.time_series_plot.create_plot(time_series_data, dataCols, title='', type='scatter', **kwargs)[source]

create plot based on the given data columns

Parameters
  • time_series_data (Time_Series_Data) – data of the plot

  • dataCols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

  • lineType (str, optional) – type of the line in the plot, by default ‘scatter’

Returns

the TimeSeriesPlot object

Return type

TimeSeriesPlot

Module contents

class time_series_transform.plot.StockPlot(stock)[source]

Bases: time_series_transform.plot.base.plot_base

class time_series_transform.plot.TimeSeriesPlot(time_series_data)[source]

Bases: time_series_transform.plot.base.plot_base

bar(cols, title='')[source]

create the bar chart of the given columns and title

Parameters
  • cols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

Returns

the current TimeSeriesPlot object

Return type

self

create_plot(dataCols, title='', lineType='scatter', **kwargs)[source]

create plot based on the given data columns

Parameters
  • dataCols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

  • lineType (str, optional) – type of the line in the plot, by default ‘scatter’

Returns

the current TimeSeriesPlot object

Return type

self

line(cols, title='')[source]

create the line chart of the given columns and title

Parameters
  • cols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

Returns

the current TimeSeriesPlot object

Return type

self

time_series_transform.plot.create_plot(time_series_data, dataCols, title='', type='scatter', **kwargs)[source]

create plot based on the given data columns

Parameters
  • time_series_data (Time_Series_Data) – data of the plot

  • dataCols (array) – array of the columns

  • title (str, optional) – title of the plot, by default “”

  • lineType (str, optional) – type of the line in the plot, by default ‘scatter’

Returns

the TimeSeriesPlot object

Return type

TimeSeriesPlot