var candleChart = {
chartVar: null,
SVGElements: {},
loadedData: {
'AAPL': {
'text': 'I want to display this text inside the new tooltip'
},
'Volume': {
'text': 'Another text'
}
},
getItemsDescription: function(serieName) {
return this.loadedData[serieName].text;
},
buildTooltip: function(text, coord) {
// we've to check if exists and remove it
try {
this.SVGElements.destroy();
} catch(e) {
// nothing
}
try {
// first of all we've to build a group to put the elements
this.SVGElements = this.chartVar.renderer.g().attr({'zIndex': 11}).add();
// build tooltip text
var textContainer = this.chartVar.renderer.text(text, coord[0], coord[1])
.attr({
'zIndex': 10
})
.add(this.SVGElements);
// get text 'box'
var box = textContainer.getBBox();
// build tooltip square according to the text location, then place the container behind the text
this.chartVar.renderer.rect(box.x - 5, box.y - 5, box.width + 10, box.height + 10, 5)
.attr({
'stroke-width': 2, // border width
'stroke': '#a8a8a8', // border color
'zIndex': 9,
'fill': 'white', // background color
'fill-opacity': 0.85, // background opacity
'isShadow': true
})
.add(this.SVGElements);
} catch(e) {
return false;
}
}
};
jQuery('#container .highcharts-legend text').live("mouseover", function(e) {
// graphic position
var coord = new Array(e.clientX, e.clientY - 40),
serieName =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.