• 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

    Setting "from" and "to" to only last 7 days without range picker

    Scheduled Pinned Locked Moved Dashboard Designer & Custom AngularJS Pages
    14 Posts 3 Posters 5.8k Views 3 Watching
    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.
    • Jared WiltshireJ Offline
      Jared Wiltshire
      last edited by

      Hey Stephen,

      Here's a quick example of how to do what you are asking for. You use the ma-now directive to get the current time then use the moment filter to manipulate the from time.

      <div layout="row">
          <md-input-container flex="">
              <label>Choose a point</label>
              <ma-point-list limit="200" ng-model="point1"></ma-point-list>
          </md-input-container>
      </div>
      
      <ma-now update-interval="1 HOURS" output="theTimeNow"></ma-now>
      
      <ma-point-values point="point1" values="point1Values"
        from="theTimeNow | moment:'startOf':'day'|moment:'subtract':7:'days'"
          to="theTimeNow" rollup="SUM" rollup-interval="1 DAYS">
      </ma-point-values>
      
      <ma-serial-chart style="height: 300px; width: 100%" series-1-values="point1Values" series-1-point="point1" default-type="column">
      </ma-serial-chart>
      

      Developer at Radix IoT

      1 Reply Last reply Reply Quote 1
      • S Offline
        StephenVDK
        last edited by

        Great that seems to have worked, Thank you.

        1 Reply Last reply Reply Quote 0
        • S Offline
          StephenVDK
          last edited by

          I may have spoke too soon.
          The graph is displaying the information the way it should be, but it's causing issues with the rest of the dashboard. It's displaying itself on other tabs, and when I click back to it's tab, it brings other graphs to that one. The graphs code are on different html files.

          1 Reply Last reply Reply Quote 0
          • Jared WiltshireJ Offline
            Jared Wiltshire
            last edited by

            If you post up your markup I'll help you.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • S Offline
              StephenVDK
              last edited by

              Here's the code, I tried using some other examples that use 'moment' from the forum and the same issue arises, but anyway:

              <h3>Weekly Heat Transfer</h3>
              <div class="row hidden-xs">
              <div class="col-sm-12 text-center extraPadding chart-holder">
              <ma-now update-interval="1 HOURS" output="theTimeNow"></ma-now>
              <ma-get-point-value point-xid="DP_672608" point="myPoint3"></ma-get-point-value>
              <ma-point-values point="myPoint3" values="point3Values"
              from="theTimeNow | moment:'startOf':'day'|moment:'subtract':7:'days'"
              to="theTimeNow" rollup="SUM" rollup-interval="1 DAYS">
              </ma-point-values>
              <ma-get-point-value point-xid="DP_284166" point="myPoint7"></ma-get-point-value>
              <ma-point-values point="myPoint7" values="point7Values" latest="8">
              </ma-point-values>
              <ma-serial-chart style="height: 300px; width: 100%"

              	series-1-values="point3Values" 
              	series-1-point="myPoint3" 
              	series-1-color="purple"
              	series-1-type="column"
              	series-3-values="point7Values"  
              	series-3-point="myPoint7"  
              	series-3-axis="right" 
              	series-3-type="column" 
              	series-3-color="green" 
              	options="{
              			valueAxes:[
              				{title:'kJ', axisColor:'black', color:'black'},
              				{title:'Outside Temp (°C)', axisColor:'green', color:'green'}
              			]
              		}">
              	</ma-serial-chart>
              </div>
              

              </div>

              1 Reply Last reply Reply Quote 0
              • Jared WiltshireJ Offline
                Jared Wiltshire
                last edited by

                I can't really solve your problems with the tabs unless you post up the full markup, please wrap the markup between three backticks so the code is formatted (use the code button on the toolbar).

                From what I can see though you are trying to plot two points on a graph but for the second point you are using latest="8" which is giving funny results, try using the same set of attributes for both <ma-point-values>

                Developer at Radix IoT

                1 Reply Last reply Reply Quote 0
                • S Offline
                  StephenVDK
                  last edited by

                  Sorry, didn't know about that button, I'll also try and change the other time scale and see what happens. Thanks

                  h3>Weekly Heat Transfer</h3>
                  <div class="row hidden-xs"> 
                    <div class="col-sm-12 text-center extraPadding chart-holder">
                      <ma-now update-interval="1 HOURS" output="theTimeNow"></ma-now>
                      <ma-get-point-value point-xid="DP_672608" point="myPoint3"></ma-get-point-value>
                      <ma-point-values point="myPoint3" values="point3Values"
                      from="theTimeNow | moment:'startOf':'day'|moment:'subtract':7:'days'"
                      to="theTimeNow" rollup="SUM" rollup-interval="1 DAYS">
                      </ma-point-values>
                      <ma-get-point-value point-xid="DP_284166" point="myPoint7"></ma-get-point-value>
                      <ma-point-values point="myPoint7" values="point7Values" latest="8">
                      </ma-point-values>
                      <ma-serial-chart style="height: 300px; width: 100%"
                  
                  	series-1-values="point3Values" 
                  	series-1-point="myPoint3" 
                  	series-1-color="purple"
                  	series-1-type="column"
                  	series-3-values="point7Values"  
                  	series-3-point="myPoint7"  
                  	series-3-axis="right" 
                  	series-3-type="column" 
                  	series-3-color="green" 
                  	options="{
                  			valueAxes:[
                  				{title:'kJ', axisColor:'black', color:'black'},
                  				{title:'Outside Temp (°C)', axisColor:'green', color:'green'}
                  			]
                  		}">
                  	</ma-serial-chart>
                    </div>
                  </div>
                  
                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    StephenVDK
                    last edited by

                    Changing the time scale for the second point to use moment didn't change any of the issues.

                    1 Reply Last reply Reply Quote 0
                    • Jared WiltshireJ Offline
                      Jared Wiltshire
                      last edited by

                      You mentioned you were having issues with tabs, if you post up your full markup for the dashboard including the tabs I can help you. Without this I am clutching at straws.

                      Developer at Radix IoT

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        StephenVDK
                        last edited by

                        Sorry but when you say full markup do you want the app.js file as well? I'm using the dashboard template and building off it.

                        1 Reply Last reply Reply Quote 0
                        • Jared WiltshireJ Offline
                          Jared Wiltshire
                          last edited by

                          Everything is preferable yes, you can email it to me at jared@infiniteautomation.com if you would like.

                          Developer at Radix IoT

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