Commit 006708d9 authored by olau@iola.dk's avatar olau@iola.dk

Modify interacting with axis example to use getAxes instead of concat

trick to avoid null axes and use axis.show guard


git-svn-id: https://flot.googlecode.com/svn/trunk@309 1e0a6537-2640-0410-bfb7-f154510ff394
parent 470456c5
...@@ -72,7 +72,10 @@ $(function () { ...@@ -72,7 +72,10 @@ $(function () {
return { left: left, top: top, width: right - left, height: bottom - top }; return { left: left, top: top, width: right - left, height: bottom - top };
} }
$.each(plot.getXAxes().concat(plot.getYAxes()), function (i, axis) { $.each(plot.getAxes(), function (i, axis) {
if (!axis.show)
return;
var box = getBoundingBoxForAxis(plot, axis); var box = getBoundingBoxForAxis(plot, axis);
$('<div class="axisTarget" style="position:absolute;left:' + box.left + 'px;top:' + box.top + 'px;width:' + box.width + 'px;height:' + box.height + 'px"></div>') $('<div class="axisTarget" style="position:absolute;left:' + box.left + 'px;top:' + box.top + 'px;width:' + box.width + 'px;height:' + box.height + 'px"></div>')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment