Trying to integrate Google Charts on my website using Flask as the backend. Need help with sending data from Flask to JavaScript. Here's a snippet of where I plan to retrieve data later:
@app.route("/")
def home():
data = {'Language': 'DATABASE','PHP': 5000,'ASP': 600,'ASPX': 1231,'PERL': 500,'JSP': 1000}
return render_template('index.html', data=data)
How can I utilize the 'data=data' here:
function drawChart(stats) {
var stats = '{{stats}}'
var data = google.visualization.arrayToDataTable([
['Language', 'IN DATABASE'],
['PHP', 5000],
['ASP', 600],
['ASPX', 1231],
['PERL', 500],
['JSP', 1000]
]);
Currently using predefined data, but plan to dynamically pull data from a SQLite database in the future for actual use.
Appreciate any assistance :D