javascript - Chart.js Tooltips customization -
i wondering how append symbol % tooltips nummeric value? i've been searching trough docs unable find it, however, on main site, they've appended size value kb pie tooltips
how can achieve similar?
thanks
well, can change tooltip template option : default :
tooltiptemplate: "<%if (label){%><%=label%>: <%}%><%= value %>" change tooltiptemplate: "<%if (label){%><%=label%>: <%}%><%= value %>%" in option object give create chart.
i used because wanted show user percentage not proportional size on chart (my donut chart represent process, , process take less time others size isn't same of them)
the exact example gave kb. here exact code copy , paste index page chart.js :
var moduledoughnut = new chart(canvas.getcontext('2d')).doughnut(moduledata, { tooltiptemplate : "<%if (label){%><%=label%>: <%}%><%= value %>kb", animation: false });
Comments
Post a Comment