本文整理汇总了Python中pythalesians.graphics.graphs.graphproperties.GraphProperties.html_file_output方法的典型用法代码示例。如果您正苦于以下问题:Python GraphProperties.html_file_output方法的具体用法?Python GraphProperties.html_file_output怎么用?Python GraphProperties.html_file_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pythalesians.graphics.graphs.graphproperties.GraphProperties
的用法示例。
在下文中一共展示了GraphProperties.html_file_output方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ticker
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
finish_date = datetime.date.today(), # finish date
freq = 'daily', # daily data
data_source = 'google', # use Bloomberg as data source
tickers = ['Apple', 'S&P500 ETF'], # ticker (Thalesians)
fields = ['close'], # which fields to download
vendor_tickers = ['aapl', 'spy'], # ticker (Google)
vendor_fields = ['Close'], # which Bloomberg fields to download
cache_algo = 'internet_load_return') # how to return data
ltsf = LightTimeSeriesFactory()
tsc = TimeSeriesCalcs()
df = tsc.create_mult_index_from_prices(ltsf.harvest_time_series(time_series_request))
gp = GraphProperties()
gp.html_file_output = "output_data/apple.htm"
gp.title = "S&P500 vs Apple"
# plot first with PyThalesians and then Bokeh
# just needs 1 word to change
gp.display_legend = False
pf = PlotFactory()
pf.plot_generic_graph(df, type = 'line', adapter = 'pythalesians', gp = gp)
pf.plot_generic_graph(df, type = 'line', adapter = 'bokeh', gp = gp)
# test simple Bokeh bar charts - monthly returns over past 6 months
if True:
from datetime import timedelta
ltsf = LightTimeSeriesFactory()
示例2: ticker
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
data_source = 'bloomberg', # use Bloomberg as data source
tickers = tickers, # ticker (Thalesians)
fields = ['close'], # which fields to download
vendor_tickers = vendor_tickers, # ticker (Bloomberg)
vendor_fields = ['PX_LAST'], # which Bloomberg fields to download
cache_algo = 'internet_load_return') # how to return data
daily_vals = ltsf.harvest_time_series(time_series_request)
pf = PlotFactory()
gp = GraphProperties()
gp.title = 'Spot values'
gp.file_output = 'demo.png'
gp.html_file_output = 'demo.htm'
gp.source = 'Thalesians/BBG'
# plot using PyThalesians
pf.plot_line_graph(daily_vals, adapter = 'pythalesians', gp = gp)
# plot using Bokeh (still needs a lot of work!)
pf.plot_line_graph(daily_vals, adapter = 'bokeh', gp = gp)
# do more complicated charts using several different Matplotib stylesheets (which have been customised)
if True:
ltsf = LightTimeSeriesFactory()
# load market data
start = '01 Jan 1970'
end = datetime.datetime.utcnow()
示例3: TimeSeriesRequest
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
if True:
time_series_request = TimeSeriesRequest(
start_date = "01 Jan 2013", # start date
finish_date = datetime.date.today(), # finish date
freq = 'daily', # daily data
data_source = 'google', # use Bloomberg as data source
tickers = ['Apple', 'S&P500 ETF'], # ticker (Thalesians)
fields = ['close'], # which fields to download
vendor_tickers = ['aapl', 'spy'], # ticker (Google)
vendor_fields = ['Close'], # which Bloomberg fields to download
cache_algo = 'internet_load_return') # how to return data
ltsf = LightTimeSeriesFactory()
tsc = TimeSeriesCalcs()
df = tsc.create_mult_index_from_prices(ltsf.harvest_time_series(time_series_request))
gp = GraphProperties()
gp.html_file_output = "apple.htm"
gp.title = "S&P500 vs Apple"
# plot first with PyThalesians and then Plotly (via Cufflinks)
# just needs 1 word to change
# (although, note that AdapterCufflinks does have some extra parameters that can be set in
# GraphProperties)
gp.display_legend = False
pf = PlotFactory()
pf.plot_generic_graph(df, type = 'line', adapter = 'pythalesians', gp = gp)
pf.plot_generic_graph(df, type = 'line', adapter = 'bokeh', gp = gp)
示例4: ticker
# 需要导入模块: from pythalesians.graphics.graphs.graphproperties import GraphProperties [as 别名]
# 或者: from pythalesians.graphics.graphs.graphproperties.GraphProperties import html_file_output [as 别名]
tickers=tickers, # ticker (Thalesians)
fields=["close"], # which fields to download
vendor_tickers=vendor_tickers, # ticker (Bloomberg)
vendor_fields=["PX_LAST"], # which Bloomberg fields to download
cache_algo="internet_load_return",
) # how to return data
daily_vals = ltsf.harvest_time_series(time_series_request)
pf = PlotFactory()
gp = GraphProperties()
gp.title = "Spot values"
gp.file_output = "output_data/demo.png"
gp.html_file_output = "output_data/demo.htm"
gp.source = "Thalesians/BBG"
# plot using PyThalesians
pf.plot_line_graph(daily_vals, adapter="pythalesians", gp=gp)
# plot using Bokeh (still needs a lot of work!)
pf.plot_line_graph(daily_vals, adapter="bokeh", gp=gp)
# do more complicated charts using several different Matplotib stylesheets (which have been customised)
if False:
ltsf = LightTimeSeriesFactory()
# load market data
start = "01 Jan 1970"
end = datetime.datetime.utcnow()