<?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[Change Bar Display bar-color based on point value]]></title><description><![CDATA[<p dir="auto">I'm trying to create a bar display of a point value, but I wanted the bar-color to be dependent on the value of the point.</p>
<p dir="auto">I tried ng-style={color:...}, but that changed the text color along with the bar color making the text illegible.</p>
<p dir="auto">I tried to put the same logic into bar-colour, but it didn't work.</p>
<p dir="auto">I'm still trying to learn more about components, but I find it confusing since many documents are based on v3 or older. Duplicating the logic in the built-in bar display but with the color change and different defaults built in would be ideal, but I can't seem to wrap my brain around making it work. I created the userModule based on the tutorial, but that's as far as I got.</p>
]]></description><link>https://forum.mango-os.com/topic/5648/change-bar-display-bar-color-based-on-point-value</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 23:17:27 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/5648.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Feb 2023 18:48:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Thu, 02 Mar 2023 14:23:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tomatopi" aria-label="Profile: tomatopi">@<bdi>tomatopi</bdi></a></p>
<pre><code>point="water"
</code></pre>
<p dir="auto">This code is assigning the point-value object to a variable in the local scope called water.  Since we are working in javascript, variables must be valid javascript variables.</p>
]]></description><link>https://forum.mango-os.com/post/27750</link><guid isPermaLink="true">https://forum.mango-os.com/post/27750</guid><dc:creator><![CDATA[CraigWeb]]></dc:creator><pubDate>Thu, 02 Mar 2023 14:23:52 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Thu, 02 Mar 2023 13:03:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/craigweb" aria-label="Profile: CraigWeb">@<bdi>CraigWeb</bdi></a> I was trying this again and it couldn't get it to work, but I found the issue.</p>
<p dir="auto">I used point="1water" and got a console error:</p>
<pre><code>Token 'water' is unexpected token at column 2 of the expression [1water] starting at [water].
</code></pre>
<p dir="auto">If I used point="water1", then it works. So if the first character of a point variable is a number, it barfs. I'm curious why that is? Is it documented anywhere? Seems a pretty important gotcha.</p>
]]></description><link>https://forum.mango-os.com/post/27749</link><guid isPermaLink="true">https://forum.mango-os.com/post/27749</guid><dc:creator><![CDATA[tomatopi]]></dc:creator><pubDate>Thu, 02 Mar 2023 13:03:30 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Wed, 01 Mar 2023 18:57:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/craigweb" aria-label="Profile: CraigWeb">@<bdi>CraigWeb</bdi></a> I tried that before and it didn't work. I tried again and now it is working.</p>
<p dir="auto">Probably a syntax error on my part. I may have used { ... } instead of {{ ... }} for the logic replicating what was in ng-style.</p>
<p dir="auto">The learning curve is a little steep. Most searches for AngularJS comes back newer Angular information, or links on the forum are often broken or redirect to something newer. What programming I do is more server-side and not Java based so it's a little frustrating. It's nice to see more activity here now. Most definitely a help.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.mango-os.com/post/27746</link><guid isPermaLink="true">https://forum.mango-os.com/post/27746</guid><dc:creator><![CDATA[tomatopi]]></dc:creator><pubDate>Wed, 01 Mar 2023 18:57:15 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Wed, 01 Mar 2023 17:46:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tomatopi" aria-label="Profile: tomatopi">@<bdi>tomatopi</bdi></a><br />
Here is a example of a built in bardisplay:</p>
<pre><code>&lt;ma-get-point-value point="myPoint" point-xid="DP_bartest"&gt;&lt;/ma-get-point-value&gt;
&lt;ma-bar-display style="height: 100px; width: 40px; background-color:#a5a5a5"  bar-color="{{myPoint.value &lt;10 ? 'red' : myPoint.value &lt;20 ? 'orange': 'green'}}" point="myPoint" minimum="0" maximum="100" direction="bottom-to-top"&gt;&lt;/ma-bar-display&gt;
</code></pre>
<p dir="auto">You can use javascript ternary operators to decide on the color of the bar, you can also chain ternary operators to have 3 diff</p>
]]></description><link>https://forum.mango-os.com/post/27745</link><guid isPermaLink="true">https://forum.mango-os.com/post/27745</guid><dc:creator><![CDATA[CraigWeb]]></dc:creator><pubDate>Wed, 01 Mar 2023 17:46:48 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Wed, 01 Mar 2023 14:39:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joeamiraglia" aria-label="Profile: joeamiraglia">@<bdi>joeamiraglia</bdi></a> That could very well do the trick. It would be similar to a VU meter, I think.</p>
<p dir="auto">Is there any examples of how to implement that? A forum search led me to one thread, but it didn't really show a working example.</p>
]]></description><link>https://forum.mango-os.com/post/27744</link><guid isPermaLink="true">https://forum.mango-os.com/post/27744</guid><dc:creator><![CDATA[tomatopi]]></dc:creator><pubDate>Wed, 01 Mar 2023 14:39:29 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Wed, 01 Mar 2023 13:28:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tomatopi" aria-label="Profile: tomatopi">@<bdi>tomatopi</bdi></a> Would this work for you?</p>
<p dir="auto"><a href="https://www.amcharts.com/demos-v3/bullet-chart-v3/" rel="nofollow ugc">https://www.amcharts.com/demos-v3/bullet-chart-v3/</a></p>
]]></description><link>https://forum.mango-os.com/post/27743</link><guid isPermaLink="true">https://forum.mango-os.com/post/27743</guid><dc:creator><![CDATA[joeamiraglia]]></dc:creator><pubDate>Wed, 01 Mar 2023 13:28:35 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Wed, 01 Mar 2023 03:56:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tomatopi" aria-label="Profile: tomatopi">@<bdi>tomatopi</bdi></a> a VU meter sounds like a good component to make... I think I'll give it a go..</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/27742</link><guid isPermaLink="true">https://forum.mango-os.com/post/27742</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 01 Mar 2023 03:56:27 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Tue, 28 Feb 2023 20:00:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> Well, dang, that's far more involved than I expected.</p>
<p dir="auto">I'm trying to find the best way to display moisture levels that's easy to glance at (since there will be near 100 of them). I want four colours to represent moisture content. Red (too dry), Orange (getting dry), Green (ideal), and Blue (over wet). Similar to a bar display or a tank or VU meter or something. I may fall back to a gauge display and have the third band end early so blue becomes blank.</p>
<p dir="auto">I don't think I'm far enough into Mango/amcharts to write a modified serialChart directive.</p>
]]></description><link>https://forum.mango-os.com/post/27741</link><guid isPermaLink="true">https://forum.mango-os.com/post/27741</guid><dc:creator><![CDATA[tomatopi]]></dc:creator><pubDate>Tue, 28 Feb 2023 20:00:32 GMT</pubDate></item><item><title><![CDATA[Reply to Change Bar Display bar-color based on point value on Tue, 28 Feb 2023 19:42:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tomatopi" aria-label="Profile: tomatopi">@<bdi>tomatopi</bdi></a> this is likely your best shot, but because they're using amcharts 3 you can't do what you want natively. <a href="https://stackoverflow.com/a/35995962" rel="nofollow ugc">https://stackoverflow.com/a/35995962</a><br />
You'd basically be having to write a modified version of the serialChart directive just so you have this function.</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/27740</link><guid isPermaLink="true">https://forum.mango-os.com/post/27740</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 28 Feb 2023 19:42:33 GMT</pubDate></item></channel></rss>