<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Chart not appearing with .resize but does with .render in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chart-not-appearing-with-resize-but-does-with/m-p/565188#M52750</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Answer&lt;/SPAN&gt;&lt;A href="http://stackoverflow.com/a/14377616/269099"&gt; here at Stack Exchange.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The reason that the chart is rendering with the default size (400 x 300px) is because the chart node (div#demoChart) does not have any dimensions.&lt;BR /&gt;&lt;BR /&gt;Furthermore, until the chart node div is visible, it will not have any actual dimensions (only style dimensions) for the chart to use. It then falls back to the default size of 300 x 400px.&lt;BR /&gt;&lt;BR /&gt;To make your code work:&lt;BR /&gt;&lt;BR /&gt;Add a css style for the div&lt;BR /&gt;&lt;BR /&gt;#demoChart {&lt;BR /&gt;&amp;nbsp; width: 175px;&lt;BR /&gt;&amp;nbsp; height: 145px;&lt;BR /&gt;}&lt;BR /&gt;Create the chart after you have shown the info window and the chart node is actually visible. The chart gets it dimensions upon instantiation (in the constructor() method, rather than in the render() method as you might expect).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, still not sure why my tooltips are not appearing.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jan 2013 01:27:48 GMT</pubDate>
    <dc:creator>SimonJackson</dc:creator>
    <dc:date>2013-01-18T01:27:48Z</dc:date>
    <item>
      <title>Chart not appearing with .resize but does with .render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chart-not-appearing-with-resize-but-does-with/m-p/565187#M52749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am dynamically creating a chart within a map popup (triggered when user clicks the map) using v3.3 (same behaviour exists with 3.2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var c = dojo.create("div", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: "demoChart"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, dojo.create('div'));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After setting the chart properties (data, theme, etc), if I call &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;chart.render&lt;/PRE&gt;&lt;SPAN&gt;, the chart renders correctly but at the wrong size (too big for the infoWindow container div).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I call &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;chart.resize(175, 145)&lt;/PRE&gt;&lt;SPAN&gt;, the chart does get created at the correct size, &lt;/SPAN&gt;&lt;STRONG&gt;but &lt;/STRONG&gt;&lt;SPAN&gt;does not get created on first click, but the second click.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To replicate please &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/jakc/Cwdyn" rel="nofollow noopener noreferrer" target="_blank"&gt;see this JSFiddle&lt;/A&gt;&lt;SPAN&gt;, and refer to lines 49-53 in the Javascript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; map.infoWindow.setContent(c);
&amp;nbsp; // Chart Resize will resize the DIV as needed.
&amp;nbsp; // However, the initial click will not show the chart
&amp;nbsp; chart.resize(175, 145);
&amp;nbsp; // Chart Render shows the chart on first click, but does not resize the div
&amp;nbsp; //chart.render();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was under the impression that the resize method included calling render within it. Therefore I am not too sure why I am getting this behaviour.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to know what needs changing in order to create the chart div at the same size as the parent div that it sits within, and appear everytime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(Bonus points for why my tooltips arent appearing as well).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:21:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chart-not-appearing-with-resize-but-does-with/m-p/565187#M52749</guid>
      <dc:creator>SimonJackson</dc:creator>
      <dc:date>2021-12-12T00:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Chart not appearing with .resize but does with .render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chart-not-appearing-with-resize-but-does-with/m-p/565188#M52750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Answer&lt;/SPAN&gt;&lt;A href="http://stackoverflow.com/a/14377616/269099"&gt; here at Stack Exchange.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The reason that the chart is rendering with the default size (400 x 300px) is because the chart node (div#demoChart) does not have any dimensions.&lt;BR /&gt;&lt;BR /&gt;Furthermore, until the chart node div is visible, it will not have any actual dimensions (only style dimensions) for the chart to use. It then falls back to the default size of 300 x 400px.&lt;BR /&gt;&lt;BR /&gt;To make your code work:&lt;BR /&gt;&lt;BR /&gt;Add a css style for the div&lt;BR /&gt;&lt;BR /&gt;#demoChart {&lt;BR /&gt;&amp;nbsp; width: 175px;&lt;BR /&gt;&amp;nbsp; height: 145px;&lt;BR /&gt;}&lt;BR /&gt;Create the chart after you have shown the info window and the chart node is actually visible. The chart gets it dimensions upon instantiation (in the constructor() method, rather than in the render() method as you might expect).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, still not sure why my tooltips are not appearing.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2013 01:27:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chart-not-appearing-with-resize-but-does-with/m-p/565188#M52750</guid>
      <dc:creator>SimonJackson</dc:creator>
      <dc:date>2013-01-18T01:27:48Z</dc:date>
    </item>
  </channel>
</rss>

