title: How do I get a handle to my dojo chart to resize it?
body: <p>I have a dojo line chart that is contained in a hidden panel.  Naturally, when the page is opened, the chart is sized with default width and height.  When I display the panel though, I want to resize the chart to fit the panel.  I found the statement, chart.resize(w,h), but I don't know how to use it.  How do I get a handle to the chart itself?  </p>
  
  <p>I create the chart using this...</p>
  
  <pre><code>var chart3 = new dojox.charting.Chart2D("#{id:panelSimpleChart}");
  </code></pre>
  
  <p>but, this just tells the chart where to render.  It's not actually assigning that id to the chart, correct?</p>
  
  <p>I found a post with a reference to doing this...</p>
  
  <pre><code>var chart = dijit.byId("#{id:panelSimpleChart}");
  if (chart != null ) {
      chart.resize(w,h);
  }
  </code></pre>
  
  <p>but, when I try that using my panel name, chart is null.</p>
  
  <p>This seems to be a simple question, but I'm a little baffled here.  Can someone point me in the right direction?</p>
  
  <p>This is the containing panel markup...</p>
  
  <pre><code>&lt;xp:panel id="panelSeatTotals"&gt;
      &lt;xp:this.styleClass&gt;&lt;![CDATA[#{javascript:"xspDisplayNone"}]]&gt;&lt;/xp:this.styleClass&gt;
  </code></pre>
  
  <p>so, it's rendered, but not displayed.</p>
  
  <p>Here's a little more of the code (with irrelevant stuff removed)</p>
  
  <pre><code>&lt;xp:repeat id="repeat1" rows="50" var="asmydata"
      indexVar="asmyindex" value="#{view1}"&gt;
      &lt;xp:panel id="panelAsmyDoc"&gt;
  ...
          &lt;xp:table&gt;
  ...
              &lt;xp:panel id="panelSeatTotals"&gt;
                  &lt;xp:this.styleClass&gt;&lt;![CDATA[#{javascript:"xspDisplayNone"}]]&gt;&lt;/xp:this.styleClass&gt;
  ...
                  &lt;xp:tr&gt;
                      &lt;xp:td
                          style="padding-left:20.0%"&gt;
                          &lt;xc:chartLine_AS&gt;&lt;/xc:chartLine_AS&gt;
                      &lt;/xp:td&gt;
  </code></pre>
  
  <p>This is from the chart cc:</p>
  
  <pre><code>&lt;xp:panel id="panelSimpleChart"
          style="width:100%; height: 400px;height:200px"&gt;
  
      &lt;/xp:panel&gt;
  </code></pre>
  
  <p>and the script...</p>
  
  <pre><code>makeCharts3 = function(){
      //line chart
     var chart3 = new dojox.charting.Chart2D("#{id:panelSimpleChart}");
  ...
  }
  XSP.addOnLoad(makeCharts3);
  </code></pre>