Database Reference
In-Depth Information
Figure 7.13
The image is still being drawn into the original viewport, which now does
not match the dimensions of the panel. To alleviate this problem, the resize
event must be captured and used to update elements that depend on the
size of the element. For example, to update the gauge element on a resize
requires several changes to each element:
$(window).resize(function() {
dim = fixup(elt);
g.attr("transform",
"translate("+(dim.width/2)+","+(dim.height/2)+")");
r = 0.5*Math.min(dim.width,dim.height) - 12.5;
arc.innerRadius(r-12.5).outerRadius(r+12.5);
 
Search WWH ::




Custom Search