How to recreate the series colored bullet in the tooltip when using a custom formatter function?

Nov 4, 2015 at 5:25 PM
Edited Nov 5, 2015 at 4:54 PM
Hello,

I am using a formatter function for the tooltip to customize/format the tooltip content display but whenever i use the formatter function for tooltip I lose the colored bullet in the tooltip provided by the library by default. Would appreciate any kind of help.

Here is the sample code.

C#:

String formatFunction = "function() { var date = new Date(this.point.x);
return (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear() + '<br/><b>' + this.series.name + '</b>: ' + displayNumberAsIntegerWithCommas(this.point.y) +'patches</b>'; }";

chart.SetTooltip(new Tooltip { Formatter = formatFunction });


JavaScript function:

function displayNumberAsIntegerWithCommas(incomingValue) {
var returnString = "";
if ( 1000 .toLocaleString("en") === "1,000.00" ) {
    // IE 8
    returnString = incomingValue.toLocaleString('en').slice(0, -3);
} else {
    // Chrome
    returnString = incomingValue.toLocaleString('en');
} 
// What about IE II?
return returnString;}