Files
TeraHz/backend/main.py
ANormalPerson1 9677273f55 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.
2019-03-21 21:18:05 +01:00

30 lines
952 B
Python

from flask import Flask, redirect, url_for, request, render_template
app = Flask(__Name__)
@app.route('/list')
def list():
#Return list json
@app.route('/load'):
def load():
#Request args, load json
@app.route('/deposit'):
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)