-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdispjsoptions.py
46 lines (41 loc) · 1.39 KB
/
dispjsoptions.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
37
38
39
40
41
42
43
44
45
46
from streamlit_echarts import st_echarts
def optionspayoff_diagram (op_strikelist, op_payofflist, maxprofit):
option = {
"tooltip": {
"trigger": 'axis',
"axisPointer": {
"type": 'cross',
"label": {
"backgroundColor": '#6a7985'
}
}
},
"visualMap": {
"top": 10,
"right": 10,
"pieces": [{
"gt": 0,
"lte": 100,
"color": '#096'
}],
"outOfRange": {
"color": '#7e0023'
}
},
"xAxis": {
"type": 'category',
"boundaryGap": "false",
"data": op_strikelist
},
"yAxis": {
"type": 'value'
},
"series": [
{
"data": op_payofflist,
"type": 'line',
"areaStyle": {}
}
]
}
return(option)