• Recent
    • Tags
    • Popular
    • Register
    • Login

    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.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Swapping in preset date ranges on ng-click

    Dashboard Designer & Custom AngularJS Pages
    1
    1
    807
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Phillip Weeks
      last edited by

      So the first thing I need to say is "I LOVE the new MANGO dashboard builder!"
      Often there is a requirement for several watchlists on one dashboard and it is cool to control all of them from a single parameter. Even cooler is the ability to synchronize all the charts on the dashboard to the same time frame. I want to share this programming technique because it is so cool. Basically you create as many <ma-date-range-picker> objects as you need PRESETS. With each button's on-click behaviour set the dateBar. to and dateBar.from to the variable set as the to and from within each <ma-date-range-picker> settings.
      So as example create an object <ma-date-range-picker id="SET_PREVIOUS_MONTH" from="prevmonth_from" to="prevmonth_to" preset="PREVIOUS_MONTH" update-interval="5 seconds" ng-show="false"> </ma-date-range-picker>

      When the user clicks the prev month button
      the ng-click="dateBar.to = prevmonth_to; dateBar.from = prevmonth_from; dateBar.rollupIntervals='1'; dateBar.rollupIntervalPeriod='DAYS'"

      and
      Brilliantly all the watchlist charts which have dateBar assigned as to and from will automatically update to this period... very cool indeed.
      Thanks team :)

      1 Reply Last reply Reply Quote 0
      • First post
        Last post