Skip to content

Commit faafb61

Browse files
committed
Dark style.
1 parent 694a758 commit faafb61

File tree

1 file changed

+44
-6
lines changed

1 file changed

+44
-6
lines changed

plotly_chartstudio_tutorial/chart.py

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from pandas import DataFrame
66
from config import PLOTLY_API_KEY, PLOTLY_USERNAME
77

8-
98
# Plotly Chart Studio authentication
109
set_credentials_file(
1110
username=PLOTLY_USERNAME,
@@ -22,15 +21,54 @@ def create_chart(stock_df: DataFrame, symbol: str) -> py.plot:
2221
high=stock_df['high'],
2322
low=stock_df['low'],
2423
close=stock_df['close'],
24+
decreasing={
25+
"line": {
26+
"color": "rgb(240, 99, 90)"
27+
},
28+
"fillcolor": "rgba(142, 53, 47, 0.5)"
29+
},
30+
increasing={
31+
"line": {
32+
"color": "rgb(48, 190, 161)"
33+
},
34+
"fillcolor": "rgba(22, 155, 124, 0.6)"
35+
},
36+
whiskerwidth=1,
2537
)],
2638
layout=go.Layout(
27-
title=f'30-day performance of {symbol.upper()}',
39+
font={
40+
"size": 15,
41+
"family": "Open Sans",
42+
"color": "#fff"
43+
},
44+
title={
45+
"x": 0.5,
46+
"font": {"size": 23},
47+
"text": f'30-day performance of {symbol.upper()}'
48+
},
2849
xaxis={
29-
'type': 'date',
30-
'rangeslider': {
31-
'visible': False
32-
},
50+
'type': 'date',
51+
'rangeslider': {
52+
'visible': False
53+
},
54+
"ticks": "",
55+
"gridcolor": "#283442",
56+
"linecolor": "#506784",
57+
"automargin": True,
58+
"zerolinecolor": "#283442",
59+
"zerolinewidth": 2
60+
},
61+
yaxis={
62+
"ticks": "",
63+
"gridcolor": "#283442",
64+
"linecolor": "#506784",
65+
"automargin": True,
66+
"zerolinecolor": "#283442",
67+
"zerolinewidth": 2
3368
},
69+
autosize=True,
70+
plot_bgcolor="rgb(23, 27, 31)",
71+
paper_bgcolor="rgb(23, 27, 31)",
3472
)
3573
)
3674
chart = py.plot(

0 commit comments

Comments
 (0)