给一个最新版本的pyecharts画图的示例
发布于 2 个月前 作者 yutiansut 221 次浏览 来自 文档

image.png

import QUANTAXIS as QA
import pyecharts.options as opts
from pyecharts.charts import Candlestick
from pyecharts.globals import CurrentConfig, NotebookType
CurrentConfig.NOTEBOOK_TYPE = NotebookType.JUPYTER_LAB


ax = QA.QA_fetch_stock_day_adv(code,start_date, end_date,collections=mgclient.stock_day).data.reset_index(1)



x_data = ax.index.map(str).values.tolist()
y_data = ax.loc[:,['open',  'close','low','high']].values.tolist()

r =(
    Candlestick(init_opts=opts.InitOpts(width="1440px", height="720px"))
    .add_xaxis(xaxis_data=x_data)
    .add_yaxis(series_name="", y_axis=y_data)
    .set_series_opts()
    .set_global_opts(
        xaxis_opts=opts.AxisOpts(is_scale=True),
        title_opts=opts.TitleOpts(title=code),
    )
)
r.load_javascript()
r.render_notebook()

image.png

回到顶部