text: var ctx=document.getElementById("doughnut-chart");Chart.defaults.global.defaultFontFamily="Arial",Chart.defaults.global.defaultFontSize=14,Chart.defaults.global.defaultFontStyle="500",Chart.defaults.global.defaultFontColor="#233d63";var chart=new Chart(ctx,{type:"doughnut",data:{datasets:[{data:[40,32,15],backgroundColor:["#7E3CF9","#F68A03","#358FF7"],hoverBorderWidth:5,hoverBorderColor:"#eee",borderWidth:3}],labels:["Direct Sales","Referral Sales","Affiliate Sales"]},options:{responsive:!0,tooltips:{xPadding:15,yPadding:15,backgroundColor:"#2e3d62"},legend:{display:!1},cutoutPercentage:60}}),myLegendContainer=document.getElementById("legend");myLegendContainer.innerHTML=chart.generateLegend();for(var legendItems=myLegendContainer.getElementsByTagName("li"),i=0;i<legendItems.length;i+=1)legendItems[i].addEventListener("click",legendClickCallback,!1);function legendClickCallback(e){for(var t=(e=e||window.event).target||e.srcElement;"LI"!==t.nodeName;)t=t.parentElement;var a=t.parentElement,l=parseInt(a.classList[0].split("-")[0],10),n=Chart.instances[l],d=Array.prototype.slice.call(a.children).indexOf(t),r=n.getDatasetMeta(0).data[d];null===r.hidden||!1===r.hidden?(r.hidden=!0,t.classList.add("hidden")):(t.classList.remove("hidden"),r.hidden=null),n.update()}