I recently change my chart from Highcharts.chart to Highcharts.stockChart.
In my previous chart, I implemented a menu to allow users to enable / disable tooltip. Here is the code I was using to do so:
Code: Select all
tooltip: {
useHTML: true,
stickOnContact: true,
formatter: function() {
if (tooltipEnabled) {
var numor = getNumor(this.x);
if (numor == 0) {
numor = 'None';
}
var tooltip = Highcharts.dateFormat('%e %b %Y, %H:%M:%S', new Date(this.x));
tooltip += '<br><b>Numor: </b>'+ numor;
tooltip += '<br><b>Value: </b>'+ this.y + ' <input id="style1" type="color" value="' + this.color + '" onchange="changeColor(' + this.series.index + ', value)">';
return tooltip;
} else {
return false;
}
}
},
Now with my stockChart I use the following code:
Code: Select all
tooltip: {
split: false, // to remove bottom tooltip
xDateFormat: '%e %b %Y, %H:%M:%S',
useHTML: true,
stickOnContact: true,
pointFormatter: function() {
if (tooltipEnabled) {
var numor = getNumor(this.x);
if (numor == 0) {
numor = 'None';
}
var tooltip = '<b>'+this.series.name+'</b>';
tooltip += '<br><b>Value: </b>'+ Highcharts.numberFormat(this.y,2,'.',' ') + ' ' + this.series.options.myParam3;
tooltip += '<br><b>Numor: </b>'+ numor + ' <input id="style1" type="color" value="' + this.color + '" onchange="changeColor(' + this.series.index + ', value)">';
return tooltip;
} else {
return false;
}
}
},
What am I doing wrong ?
Thanks !