-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhigh.py
More file actions
52 lines (48 loc) · 1.24 KB
/
Copy pathhigh.py
File metadata and controls
52 lines (48 loc) · 1.24 KB
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
47
48
49
50
51
52
from highcharts import Highchart
chart = Highchart()
chart.set_options('chart', {'inverted': True})
options = {
'title': {
'text': 'Atmosphere Temperature by Altitude'
},
'subtitle': {
'text': 'According to the Standard Atmosphere Model'
},
'xAxis': {
'reversed': False,
'title': {
'enabled': True,
'text': 'Altitude'
},
'labels': {
'formatter': 'function () {\
return this.value + "km";\
}'
},
'maxPadding': 0.05,
'showLastLabel': True
},
'yAxis': {
'title': {
'text': 'Temperature'
},
'labels': {
'formatter': "function () {\
return this.value + '°';\
}"
},
'lineWidth': 2
},
'legend': {
'enabled': False
},
'tooltip': {
'headerFormat': '<b>{series.name}</b><br/>',
'pointFormat': '{point.x} km: {point.y}°C'
}
}
chart.set_dict_options(options)
data = [[0, 1], [10, -50], [20, -56.5], [30, -46.5], [40, -22.1],
[50, -2.5], [60, -27.7], [70, -55.7], [80, -76.5]]
chart.add_data_set(data, 'spline', 'Temperature', marker={'enabled': False})
chart.save_file()