let p1 = js_vars.winChanceP1; let p2 = js_vars.winChancePC; const ctx = document.getElementById('pie_chart_result') const colors = ['#CBD6C6','#AFDAD1']; var pieChart1 = new Chart(ctx,{ type:'pie', data: { labels: ['You', 'The other group member'], datasets: [ { data: [p1, p2], backgroundColor: colors, borderWidth:1 } ], options: { rotation: 180 } } });