Template:Flot ffcp hg19: Difference between revisions
From FANTOM5_SSTAR
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
grid: { hoverable: true, clickable: true }, | grid: { hoverable: true, clickable: true }, | ||
}); | }); | ||
function showTooltip(x, y, contents) { | |||
$('<div id="tooltip">' + contents + '</div>').css( { | |||
position: 'absolute', | |||
display: 'none', | |||
top: y + 5, | |||
left: x + 5, | |||
border: '1px solid #fdd', | |||
padding: '2px', | |||
'background-color': '#fee', | |||
opacity: 0.80 | |||
}).appendTo("body").fadeIn(200); | |||
} | |||
var previousPoint = null; | |||
$("#charthg19").bind("plothover", function (event, pos, item) { | |||
$("#x").text(pos.x.toFixed(2)); | |||
$("#y").text(pos.y.toFixed(2)); | |||
if (item) { | |||
if (previousPoint != item.dataIndex) { | |||
previousPoint = item.dataIndex; | |||
$("#tooltip").remove(); | |||
var x = item.datapoint[0].toFixed(0), | |||
y = item.datapoint[1].toFixed(2); | |||
showTooltip(item.pageX, item.pageY, | |||
"Cage Peak: "+item.series.label+"<br>Sample: "+series[x]+"<br>Phase1_expression: "+y); | |||
} | |||
} | |||
else { | |||
$("#tooltip").remove(); | |||
previousPoint = null; | |||
} | |||
}); | |||
Revision as of 10:47, 13 March 2012
CAGE Peaks (hg19)
Sample of clicked point: