diff --git a/backend/graph.js b/backend/graph.js new file mode 100644 index 0000000..1c053db --- /dev/null +++ b/backend/graph.js @@ -0,0 +1,9 @@ +$(document).ready(function() { + $(chart_id).highcharts({ + chart: chart, + title: title, + xAxis: xAxis, + yAxis: yAxis, + series: series + }); +}); \ No newline at end of file diff --git a/backend/main.py b/backend/main.py index 27c0d5c..e0c6b55 100644 --- a/backend/main.py +++ b/backend/main.py @@ -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) \ No newline at end of file diff --git a/frontend/website.html b/backend/website.html similarity index 53% rename from frontend/website.html rename to backend/website.html index 31392a5..1fdd49f 100644 --- a/frontend/website.html +++ b/backend/website.html @@ -18,11 +18,29 @@