let p1 = js_vars.p1; let p2 = js_vars.p2; let p3 = js_vars.p3; const ctx = document.getElementById('pie_chart_result') const colors = ['#CBD6C6','#A9BF59','#609653']; var pieChart1 = new Chart(ctx,{ type:'pie', data: { labels: ['You', '1st active other', '2nd active other'], datasets: [ { data: [p1, p2, p3], backgroundColor: colors, borderWidth:1 } ], options: { rotation: 180 } } });