Skip to content

Commit 0589daf

Browse files
committed
Improvements to graph - allow interactive pan & zoom
1 parent d75d8b5 commit 0589daf

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

resources/html/chart.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,33 @@
66
<script language="javascript" type="text/javascript" src="../js/jquery.flot.js"></script>
77
<!-- flot grow plugin: see http://jumware.com/Includes/jquery/Flot/Doc/JQuery.flot.grow.html -->
88
<script language="javascript" type="text/javascript" src="../js/jquery.flot.grow.js"></script>
9+
<script language="javascript" type="text/javascript" src="../js/jquery.flot.navigate.js"></script>
910
</head>
1011
<body>
1112
<div id="chart"><h1>Histogram loading...</h1></div>
1213
<script id="source" language="javascript" type="text/javascript">
1314
var d = new Array();
1415
function replot()
1516
{
16-
var options = { series : {
17-
grow : { active : true },
18-
points : { show : true },
19-
grow : { stepMode : "maximum", steps: 120 },
20-
lines : { show : true }
21-
}
17+
var options = { series :
18+
{
19+
grow : { active : true },
20+
points : { show : true },
21+
grow : { stepMode : "maximum", steps: 120 },
22+
lines : { show : true },
23+
},
24+
yaxis : { zoomRange: null, panRange: null },
25+
xaxis : { zoomRange: null, panRange: null },
26+
zoom : { interactive : true },
27+
pan : { interactive : true }
2228
};
2329
$.plot($("#chart"), d, options);
2430
}
2531
function addSeries( theSeries )
2632
{
2733
d.push( { data: theSeries } );
2834
replot();
29-
alert( theSeries );
35+
//alert( theSeries );
3036
}
3137
$(function ()
3238
{

0 commit comments

Comments
 (0)