<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Amcharts on-init zoom]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">I am playing around with the latest mango and with AmCharts. I would like to do prezoom of the rendered chart but I am failing with it. Have tried multiple ways with declaring indexes, categoryvalues or dates. If used with dates chart fails to render and console points that the variable is not date object, i.e.</p>
<pre><code>TypeError: Cannot read property 'getTime' of undefined
</code></pre>
<p dir="auto">Code while the upper error.</p>
<pre><code>&lt;ma-now output="now"&gt;&lt;/ma-now&gt;

&lt;ma-calc input="now | maMoment:'subtract':12:'hours'" output="from"&gt;&lt;/ma-calc&gt;

&lt;ma-get-point-value point-xid="dptest1" point="point1"&gt;&lt;/ma-get-point-value&gt;
&lt;ma-get-point-value point-xid="dptest2" point="point2"&gt;&lt;/ma-get-point-value&gt;

&lt;ma-point-values point="point1" values="point1Values" from="dateBar.from" to="dateBar.to"&gt;
&lt;/ma-point-values&gt;

&lt;ma-serial-chart style="height: 300px; width: 100%" series-1-values="point1Values" series-1-point="point1" series-1-type="line" series-1-color="blue" legend="true" balloon="true" on-chart-init="$chart.zoomToDates(from, now)" series-1-graph-options="{id:'graph-id'}" options="{ zoomOutOnDataUpdate:false, valueAxes:[{minimum:0, axisColor:point1Color, color:point1Color}, {axisColor:point2Color, color:point2Color}],chartScrollbar:{autoGridCount: true,resizeEnabled:false,scrollbarHeight: 50, graph:'graph-id' }}"&gt;
&lt;/ma-serial-chart&gt;
</code></pre>
<p dir="auto">Can somebody please advice how to use</p>
<pre><code>on-chart-init="$chart.zoomToDates()"
</code></pre>
<p dir="auto">Or some otherway to create specific prezoom after first rendering.</p>
<p dir="auto">Thanks,<br />
Thomas</p>
]]></description><link>https://forum.mango-os.com/topic/3595/amcharts-on-init-zoom</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Nov 2026 00:09:37 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/3595.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Jun 2018 20:05:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Amcharts on-init zoom on Mon, 16 Jul 2018 02:43:39 GMT]]></title><description><![CDATA[<p dir="auto">Nicely done. I would have suggested code but it's always hard to gauge someone's coding skill level. Best of luck with future projects.</p>
]]></description><link>https://forum.mango-os.com/post/19210</link><guid isPermaLink="true">https://forum.mango-os.com/post/19210</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Mon, 16 Jul 2018 02:43:39 GMT</pubDate></item><item><title><![CDATA[Reply to Amcharts on-init zoom on Wed, 11 Jul 2018 14:27:03 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> !</p>
<p dir="auto">Sorry for replying so late but I went with your suggestion on doing some programming for achieving the results which I need.</p>
<p dir="auto">I was pleased to see your requests / posts on the forum which pointed me to right directions while customizing for new directives.</p>
<p dir="auto">Mainly where <a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: jared-wiltshire">@<bdi>jared-wiltshire</bdi></a> said in <a href="/post/18672">future defining of usermodule required scripts/functions help</a>:</p>
<blockquote>
<p dir="auto"><a href="https://github.com/infiniteautomation/ma-dashboards/blob/3.3.x/UI/web/ngMango/directives/PointValueController.js" rel="nofollow ugc">https://github.com/infiniteautomation/ma-dashboards/blob/3.3.x/UI/web/ngMango/directives/PointValueController.js</a></p>
</blockquote>
<p dir="auto">Which helped my a lot for customizing Mangos own directives in the future as for 3.3.x all the directives and components are in AMD/Require style which usermodules use.</p>
<p dir="auto">If someone have not noticed then this should be number one place to go to see how <a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: Jared-Wiltshire">@<bdi>Jared-Wiltshire</bdi></a>  has done the directives.  <a href="https://github.com/infiniteautomation/ma-dashboards/blob/3.3.x/UI/web/ngMango/" rel="nofollow ugc">https://github.com/infiniteautomation/ma-dashboards/blob/3.3.x/UI/web/ngMango/</a></p>
<p dir="auto">I'll put out the customized directive and component if someone wants to use prezooming, start-end date of the zoom for further data analysis.</p>
<p dir="auto"><a href="https://pastebin.com/8h4MV8B1" rel="nofollow ugc">https://pastebin.com/8h4MV8B1</a></p>
<p dir="auto">I changed the dateformats from original as ngMango own directive uses other services etc.</p>
<p dir="auto">Function pointValueToString was taken from <a href="https://github.com/infiniteautomation/ma-dashboards/blob/3.3.x/UI/web/ngMango/services/Util.js" rel="nofollow ugc">https://github.com/infiniteautomation/ma-dashboards/blob/3.3.x/UI/web/ngMango/services/Util.js</a></p>
<p dir="auto">Added bindings:</p>
<p dir="auto">End - takes timestamp of zoom end<br />
hours - takes a number of hours and then uses moment for subtracting the hours from end zoom.<br />
selected - Object output binding</p>
<ul>
<li>selected.start &gt;&gt; zoomed chart start date</li>
<li>selected.end &gt;&gt;  zoomed chart end date</li>
</ul>
<p dir="auto">Example usage:</p>
<pre><code>&lt;my-custom-mango-chart id="8ec0e029-4b0b-4f53-aa0d-6c25b4ds22sssdsdbfa991" style="position: absolute; left: 1058px; top: 1022px; width: 798px; height: 500px;"  series-1-values="tank1Values" series-1-point="tank1" series-1-type="line" series-1-color="blue" legend="true" balloon="true" cursor-sync-id="graphs" series-1-graph-options="{id:'graph-id-2'}" end="start2.time" hours="6" options="{ zoomOutText: '',chartScrollbar:{graph:'graph-id-2' }}"&gt;
&lt;/my-custom-mango-chart&gt;
</code></pre>
<p dir="auto">These dates can be used as variables for ma-point-statistics directive to get current selection statistics for example.</p>
<p dir="auto">As Angular is still quite hard I'll keep learnin and askin. But as <a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: Jared-Wiltshire">@<bdi>Jared-Wiltshire</bdi></a> and all of you in IAS staff are publishing all online it is relatively easier to customize and learn.</p>
<p dir="auto">Huge thanks and cheers!</p>
<p dir="auto">Thomas</p>
]]></description><link>https://forum.mango-os.com/post/19178</link><guid isPermaLink="true">https://forum.mango-os.com/post/19178</guid><dc:creator><![CDATA[ThomasEinasto]]></dc:creator><pubDate>Wed, 11 Jul 2018 14:27:03 GMT</pubDate></item><item><title><![CDATA[Reply to Amcharts on-init zoom on Tue, 19 Jun 2018 20:53:26 GMT]]></title><description><![CDATA[<p dir="auto">If that's the case, will it be a fixed timeframe? You can use maMoment filter to set now and maMoment:'add' : '12' :'hours'  to fix the period. That would remove the need for a datebar so the user cannot select the date range.</p>
<p dir="auto">Noting that if you're going to be utilising a variable 12 hour timeframe depending on certain factors then some programming will be involved to make it handle things in a dynamic fashion.</p>
]]></description><link>https://forum.mango-os.com/post/18964</link><guid isPermaLink="true">https://forum.mango-os.com/post/18964</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 19 Jun 2018 20:53:26 GMT</pubDate></item><item><title><![CDATA[Reply to Amcharts on-init zoom on Tue, 19 Jun 2018 20:30:59 GMT]]></title><description><![CDATA[<p dir="auto">Actually I am trying to achieve a page where the user after he opens up the page is zoomed and will stay zoomed for a 12 hour period even though the whole period might have been 18 hours.</p>
<p dir="auto">The user can see the whole graph on the chartScrollbar as I have defined the graph to there with assigned ID but only the 12 hour selected part is important for further things.</p>
<p dir="auto">We can also say that the prezoom is a selection of 12 hour period of a 18 hour graph.</p>
<p dir="auto">I also will add to the options</p>
<pre><code>chartCursor:{zoomable:false},
</code></pre>
<p dir="auto">So that the user cannot change the zoom of the current selection.</p>
]]></description><link>https://forum.mango-os.com/post/18963</link><guid isPermaLink="true">https://forum.mango-os.com/post/18963</guid><dc:creator><![CDATA[ThomasEinasto]]></dc:creator><pubDate>Tue, 19 Jun 2018 20:30:59 GMT</pubDate></item><item><title><![CDATA[Reply to Amcharts on-init zoom on Tue, 19 Jun 2018 20:16:49 GMT]]></title><description><![CDATA[<p dir="auto">Define pre-zoom, if you're trying to view a respective date range in detail why not just use that as your set date/time range for when the chart loads? It will then provide you with the data range in question in more detail.</p>
]]></description><link>https://forum.mango-os.com/post/18962</link><guid isPermaLink="true">https://forum.mango-os.com/post/18962</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 19 Jun 2018 20:16:49 GMT</pubDate></item></channel></rss>