Skip to content

Commit 076bfad

Browse files
committed
Introduced latest_date variable
1 parent 0428eca commit 076bfad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

example/plots.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def main(argv=None):
7878
data = list(load_data(file_in_data))
7979
values = load_values(file_in_values)
8080

81+
latest_date = data[-1]['date']
82+
8183
if args.plot_rate:
8284
fig = px.line(
8385
data,
@@ -88,7 +90,7 @@ def main(argv=None):
8890
)
8991
fig.add_vline(
9092
annotation_text='today',
91-
x=dt.combine(data[-1]['date'], dt.min.time()).timestamp() * 1000,
93+
x=dt.combine(latest_date, dt.min.time()).timestamp() * 1000,
9294
line_color='#0cc',
9395
)
9496
fig.show()
@@ -118,7 +120,7 @@ def main(argv=None):
118120
)
119121
fig.add_vline(
120122
annotation_text='today',
121-
x=dt.combine(data[-1]['date'], dt.min.time()).timestamp() * 1000,
123+
x=dt.combine(latest_date, dt.min.time()).timestamp() * 1000,
122124
line_color='#0cc',
123125
)
124126
fig.show()
@@ -148,7 +150,7 @@ def main(argv=None):
148150
)
149151
fig.add_vline(
150152
annotation_text='today',
151-
x=dt.combine(data[-1]['date'], dt.min.time()).timestamp() * 1000,
153+
x=dt.combine(latest_date, dt.min.time()).timestamp() * 1000,
152154
line_color='#0cc',
153155
)
154156
fig.show()

0 commit comments

Comments
 (0)