var = new CanvasJS.Chart("", { fitInfo: { canvasComponentType: "StackByProject" }, animationEnabled: true, exportEnabled: true, title:{ text: "Counts By Project", fontFamily: "'Calibri',sans-serif", //fontColor: "#695A42", fontColor: "black", fontWeight: "bold", fontSize: 14 }, //axisX: { /// interval: 1, // intervalType: "Project" //}, axisY:{ label:"Risks", gridColor: "#B6B1A8", tickColor: "#B6B1A8", //valueFormatString: "#0.#,." }, toolTip: { shared: true, borderColor: 'gray', backgroundColor: "#eee", cornerRadius: 2, borderThickness: 2, content: riskStackToolTipContent }, data: [ ] }); .render(); enableCanvasFitOptions(); function riskStackToolTipContent(e) { var str = ""; var total = 0; var str2, str3; for (var i = 0; i < e.entries.length; i++){ var str1 = " "+e.entries[i].dataSeries.legendText+": "+e.entries[i].dataPoint.y+"
"; total = e.entries[i].dataPoint.y + total; str = str.concat(str1); } str2 = ""; //""+(e.entries[0].dataPoint.x).getFullYear()+"
"; //total = Math.round(total * 100) / 100; str3 = "Total: "+total+"
"; return (str2.concat(str)).concat(str3); } function onStackClick(e){ alert(" Run Filter on dataPoint { Project:" + e.dataPoint.label + ", Severity: "+ e.dataSeries.legendText + " }" ); }