5
5
from pandas import DataFrame
6
6
from config import PLOTLY_API_KEY , PLOTLY_USERNAME
7
7
8
-
9
8
# Plotly Chart Studio authentication
10
9
set_credentials_file (
11
10
username = PLOTLY_USERNAME ,
@@ -22,15 +21,54 @@ def create_chart(stock_df: DataFrame, symbol: str) -> py.plot:
22
21
high = stock_df ['high' ],
23
22
low = stock_df ['low' ],
24
23
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 ,
25
37
)],
26
38
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
+ },
28
49
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
33
68
},
69
+ autosize = True ,
70
+ plot_bgcolor = "rgb(23, 27, 31)" ,
71
+ paper_bgcolor = "rgb(23, 27, 31)" ,
34
72
)
35
73
)
36
74
chart = py .plot (
0 commit comments