From: Dan Vanderkam Date: Sat, 29 Jan 2011 17:45:11 +0000 (-0500) Subject: padding X-Git-Tag: v1.0.0~584^2~3 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=36f05c4275ac5966400894aa641de4ce24f593d9;p=dygraphs.git padding --- diff --git a/gadget.xml b/gadget.xml index 16f9419..07a1aba 100644 --- a/gadget.xml +++ b/gadget.xml @@ -10,7 +10,6 @@ screenshot="http://dygraphs.com/screenshot.png" author_location="US" > - --> @@ -29,10 +28,6 @@ - var gadgetHelper = null; var table = null; + var kPadding = 5; // pixels of padding on any side of the chart. _IG_RegisterOnloadHandler(loadVisualizationAPI); @@ -65,8 +61,11 @@ function sendQuery() { var prefs = new _IG_Prefs(); // User preferences var chartDiv = _gel('chartdiv'); - chartDiv.style.width = document.body.clientWidth + 'px'; - chartDiv.style.height = document.body.clientHeight + 'px'; + chartDiv.style.width = (document.body.clientWidth - 2 * kPadding) + 'px'; + chartDiv.style.height = (document.body.clientHeight - 2 * kPadding) + 'px'; + chartDiv.style.left = kPadding + 'px'; + chartDiv.style.top = kPadding + 'px'; + chartDiv.style.position = 'absolute'; chart = new DateGraph.GVizChart(chartDiv); gadgetHelper = new google.visualization.GadgetHelper();