-
Notifications
You must be signed in to change notification settings - Fork 26
/
app.py
82 lines (57 loc) · 2.18 KB
/
app.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020/8/26 14:48
# @Author : way
# @Site :
# @Describe:
from flask import Flask, render_template
from data import SourceData
app = Flask(__name__)
source = SourceData()
@app.route('/')
def index():
return render_template('index.html')
@app.route('/line')
def line():
data = source.line
return render_template('line.html', title=data.title, data=data.values, legend=data.legend, xAxis=data.xAxis,
unit=data.unit)
@app.route('/bar')
def bar():
data = source.bar
return render_template('bar.html', title=data.title, data=data.values, legend=data.legend, xAxis=data.xAxis,
unit=data.unit)
@app.route('/bar_y')
def bar_y():
data = source.bar_y
return render_template('bar_y.html', title=data.title, data=data.values, legend=data.legend, xAxis=data.xAxis,
unit=data.unit)
@app.route('/bar_polar')
def bar_polar():
data = source.bar_polar
return render_template('bar_polar.html', title=data.title, data=data.values, legend=data.legend, xAxis=data.xAxis,
unit=data.unit)
@app.route('/bar_waterfall')
def bar_waterfall():
data = source.bar_waterfall
return render_template('bar_waterfall.html', title=data.title, data=data.values, legend=data.legend,
xAxis=data.xAxis, special=data.special,
unit=data.unit)
@app.route('/pie')
def pie():
data = source.pie
return render_template('pie.html', title=data.title, data=data.values, legend=data.legend, unit=data.unit)
@app.route('/pie_doughnut')
def pie_doughnut():
data = source.pie_doughnut
return render_template('pie_doughnut.html', title=data.title, data=data.values, legend=data.legend, unit=data.unit)
@app.route('/china')
def china():
data = source.china
return render_template('china.html', title=data.title, data=data.values, unit=data.unit)
@app.route('/wordcloud')
def wordcloud():
data = source.wordcloud
return render_template('wordcloud.html', title=data.title, data=data.values, unit=data.unit)
if __name__ == "__main__":
app.run(host='127.0.0.1', debug=True)