Skip to content

Commit

Permalink
use zvdata 1.0.1
Browse files Browse the repository at this point in the history
Former-commit-id: a63cd66
  • Loading branch information
foolcage committed Nov 14, 2019
1 parent 2c5959c commit 4281c03
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
zvdata == 1.0.0
zvdata == 1.0.1
Scrapy == 1.5.1
requests == 2.20.1
SQLAlchemy == 1.2.14
Expand Down
17 changes: 14 additions & 3 deletions zvt/drawer/drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@


class Drawer(object):
def __init__(self, data: NormalData, sub_data: NormalData = None, annotation_df: pd.DataFrame = None) -> None:
def __init__(self,
main_df: pd.DataFrame = None,
sub_df: pd.DataFrame = None,
main_data: NormalData = None,
sub_data: NormalData = None,
annotation_df: pd.DataFrame = None) -> None:
# 主图数据
self.main_data: NormalData = data
if main_data is None:
main_data = NormalData(main_df)
self.main_data: NormalData = main_data

# 副图数据
if sub_data is None:
sub_data = NormalData(sub_df)
self.sub_data: NormalData = sub_data

# 主图的标记数据
self.annotation_df = annotation_df

Expand Down Expand Up @@ -386,7 +397,7 @@ def to_annotations(annotation_df: pd.DataFrame):
#
# drawer = Drawer(data=NormalData(df=df.loc[:, ['close']]))
# drawer.draw_histogram(entity_in_subplot=True)
drawer = Drawer(data=NormalData(df), sub_data=NormalData(df1[['current_count']]))
drawer = Drawer(df, df1[['current_count']])
drawer.draw_kline()

# df1 = df.copy()
Expand Down

0 comments on commit 4281c03

Please sign in to comment.