Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Help Setting Serial Chart From and To
-
I have a watch list serial chart in a dashboard. I do not want the From and To to be populated by datebar.To and datebar.From instead I want it to always be the trailing 7 days and still enable the user to zoom if desired.
So ideally it would be like:
to: datetime.datetime.now()
from: datetime.datetime.now() - timedelta(days=7)Any thoughts on how to achieve this are much appreciated.
Thanks
-
Hi chio,
You could achieve this with an ma-date-range-picker that was hidden on the page. Something like,
<ma-date-range-picker style="display: none" preset="LAST_1_WEEKS" to="toTimestamp" from="fromTimestamp"></ma-date-range-picker>
and then use the toTimestamp and fromTimestamp in the chart's markup.
-
@phildunlap thanks this worked great
-
Glad to hear it, I mostly took it from this thread: https://forum.infiniteautomation.com/topic/3590/ma-date-range-picker