-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kline_test.py
39 lines (35 loc) · 1.04 KB
/
Kline_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#画K线的测试脚本
import pyecharts.options as opts
from pyecharts.charts import Kline,Line
import baostock as bs
import pymysql
import datetime
from pyecharts.charts import Page
Pa=Page()
# data=[[15,15.9,14.8,15.3],[16,16.8,14.6,15.9]]
data=[[15,15.3,14.8,15.9],[16,15.9,14.6,16.8]]
c=(
Kline()
.add_xaxis(['2020-01-02','2020-01-03'])
.add_yaxis("kline",
data,
itemstyle_opts=opts.ItemStyleOpts(
color="#ec0000",
color0="#00da3c",
border_color="#8A0000",
border_color0="#008F28",
)
)
.set_global_opts(
xaxis_opts=opts.AxisOpts(is_scale=True),
yaxis_opts=opts.AxisOpts(
is_scale=True,
splitarea_opts=opts.SplitAreaOpts(
is_show=True, areastyle_opts=opts.AreaStyleOpts(opacity=1)
),
),
title_opts=opts.TitleOpts(title="K-line"),
)
)
Pa.add(c)
Pa.render('cc.html')