Attempt at doing json

I fucked up big time. I have attempted to make a custom made chart, while, to my knowledge, one is readily available and more easily incorporated to the website design.
This commit is contained in:
ANormalPerson1
2019-03-21 21:18:05 +01:00
parent 6c63adcdfb
commit 9677273f55
6 changed files with 76 additions and 3 deletions
+15 -1
View File
@@ -1,4 +1,4 @@
from flask import Flask, redirect, url_for, request
from flask import Flask, redirect, url_for, request, render_template
app = Flask(__Name__)
@app.route('/list')
@@ -14,3 +14,17 @@ def deposit():
#Request .json, store json
if request.isJson():
request.json.
@app.route('/graph')
def graph(chartID = 'chart_ID', chart_type = 'line', chart_height = 500):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}
xAxis = {"categories": ['xAxis Data1', 'xAxis Data2', 'xAxis Data3']}
yAxis = {"title": {"text": 'yAxis Label'}}
return render_template('index.html', chartID=chartID, chart=chart, series=series, title=title, xAxis=xAxis, yAxis=yAxis)
if __name__ == "__main__":
app.run(debug = True, host='0.0.0.0', port=8080, passthrough_errors=True)