You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.6 KiB
68 lines
1.6 KiB
<!doctype html> |
|
|
|
<html> |
|
<head> |
|
<meta charset="utf-8"> |
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|
|
|
<title>flot.tooltip plugin example page</title> |
|
<meta name="author" content="@krzysu, myviews.pl"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
|
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> |
|
<!--[if lte IE 8]><script src="../js/excanvas.min.js"></script><![endif]--> |
|
<script src="js/jquery.flot.js"></script> |
|
<script src="../js/jquery.flot.tooltip.js"></script> |
|
|
|
<style type="text/css"> |
|
body {font-family: sans-serif; font-size: 16px; margin: 50px; max-width: 800px;} |
|
#flotTip {} |
|
</style> |
|
</head> |
|
|
|
<body> |
|
<h1>flot.tooltip plugin example page</h1> |
|
|
|
<div id="placeholder" style="width: 825px; height: 150px;"></div> |
|
<a href="javascript:void(0);" class="button" id="replot">Plot</a> |
|
|
|
<script type="text/javascript"> |
|
$(document).ready(function(){ |
|
|
|
plot(); |
|
|
|
function plot(){ |
|
var values = [ [0.75, 123], [1, 550], [2.823695, 320], [3, 700],[4,17000],[5,300] ] |
|
|
|
var options = { |
|
series: { |
|
lines: { show: true }, |
|
points: { show: true } |
|
}, |
|
grid: { |
|
hoverable: true //IMPORTANT! this is needed for tooltip to work |
|
}, |
|
yaxis:{ |
|
tickFormatter: function(val, axis) { |
|
return '$' + val.toLocaleString()+"$"; |
|
}, |
|
}, |
|
tooltip: { |
|
show: true, |
|
content: "%s of %x.2 is %y", |
|
shifts: { |
|
x: -60, |
|
y: 25 |
|
} |
|
} |
|
}; |
|
|
|
var plotObj = $.plot( $("#placeholder"), |
|
[ { data: values, label: "Series 1"}], |
|
options ); |
|
} |
|
}); |
|
</script> |
|
|
|
</body> |
|
</html>
|
|
|