score:0

Accepted answer

already found : between line 999 and 1023 in chart.js before drawing - i've added the line

id: chartelements[0].id,

so the data with the name id is in the dom avaiable.

score:1

as an alternative pass a json string as your label, then intercept to render. for example:

    var canvas = document.getelementbyid(id);
    var d = canvas.getcontext("2d");
    var chart = new chart(d).pie(json, {
        segmentstrokewidth: 1,
        tooltiptemplate: "<%=label%>", //default the label
        customtooltips: function (tooltip) {

            // hide if no tooltip
            if (!tooltip) {
                return;
            }
            var tooltipobj = json.parse(tooltip.text);
            // etc

Related Query

More Query from same tag