I am a bit confused, this is what my flask and JS looks like, wtime shows up correctly in the graph, but I cannot get {{wtech}} to work as a flask value in JS. Been racking my brain for quite some time on this. I would much rather use my Flask variable than having to resort to using JSON, as it is much easier to code and less time consuming.
It works perfectly fine for {{wtime}} (for the data) but will not with {{wtech}} for the labels
Flask:
wtech = ['Tech1','Tech2']
wtime = [3,4]
res = make_response(render_template("timeman.html", wtech = wtech,
wtime = wtime))
Javascript:
<script>
var cty = document.getElementById("chartBig2").getContext("2d");
var data = {
labels: ['Tech1','Tech2'],
datasets: [{
label: "Data",
fill: true,
backgroundColor: ['#1d1d2e', '#2d2f54'],
borderColor: '#d048b6',
borderWidth: 2,
data: {{wtime}}, }]};
var myDough = new Chart(cty, {type: 'doughnut', data: data, options: gradientDoughOptionsConfiguration});
</script>