DIAdem Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
JoshRew

Optional REPORT Y-Axis auto-scaling for manual X-Axis range

Status: Under Consideration

Hello

Thank you for your request. R&D has read this suggestion and it will be included in feature planning discussions for future DIAdem versions.

Greetings

Walter

Make an option to have REPORT auto-scaling work like VIEW:

VIEW updates the Y-Axis range to be appropriate for the presently visible data when Y-Axis auto-scaling is on and a manual X-Axis range is selected.

REPORT presently maintains the Y-Axis scale of the entire Y-Axis channel's range regardless of X-Axis range selection.

 

DIAdem Axis Scaling Behavior.jpg

 

The current behavior requires the user to manually scale both the X and Y axis, when manually selecting an X-Axis range on a highly variable data set.  In my case, I'm setting the X-Axis range in a script (last 30 days), but will now also have to determine and set a manual Y-Axis range for the 30 day window of X-Axis values.

 

I put "Optional" in the description because sometimes the current behavior is desired (if the user wishes to maintain a consistent Y-Axis at all times).

 

-Josh

 

7 Comments
Missy_Conley
Member

Having report autoscale like view does would save a massive amount of time when reviewing data over a specific time period.

 

-Missy

shevonv
Member

 -JoshRew - How did you manage to set the x axis range in a script? Do you have something you can share? I have daily set points that I look at and for the first few days its fine. After about 50 days, it gets pretty hard to look at data since the x range keeps getting bigger. I would like it to just plot only the last 20 days of data. 

JoshRew
Member

Shevonv, the report TDR is loaded as part of a script that also updates the graphs.  Here's most of the relevant code, which uses the X-Channel TimeStampAbsolute to determine 30 days from the most recent test and set the X-Axis where necessary:

Dim XMaxDate

Dim NumDays

Dim oCurrObj, o2DAxisXScaling

Dim i, j

NumDays = 30

if cno("TimeStampAbsolute") > 0 then

   XMaxDate = cmax("TimeStampAbsolute") 'Get the most recent test's date

   XMaxDate = cdate(str(XMaxDate,"#mm/dd/yyyy")) + 1 'Chop off the time and add a day to offset from the end of the graph

   For i = 1 to Report.Sheets.Count 'Loop through all sheets

     For j = 1 to Report.Sheets(i).Objects.Count 'Loop through all sheet objects

       Set oCurrObj = Report.Sheets(i).Objects(j)

       Select Case oCurrObj.ObjectType

       Case eReportObject2DAxisSystem 'Update X-Axis scaling on all 2D Axis objects, regardless of name (no other objects)

         '------------------- 2DAxisXScaling ------------------------------

         Set o2DAxisXScaling = oCurrObj.XAxis.Scaling

          o2DAxisXScaling.AutoScalingType = eAxisAutoScalingManual

          o2DAxisXScaling.Type = e2DXScalingDateTime

          o2DAxisXScaling.Begin = Val(XMaxDate - NumDays)

           o2DAxisXScaling.Origin = o2DAxisXScaling.Begin

           o2DAxisXScaling.End = Val(XMaxDate)

        End Select

      Next 'j

    Next 'i

end if

shevonv
Member

Thanks JoshRew for sharing. I'd certainly be able to modify my code to incorporate this as well when I launch my script.

Walter_Rick
NI Employee (retired)
Status changed to: Under Consideration

Hello

Thank you for your request. R&D has read this suggestion and it will be included in feature planning discussions for future DIAdem versions.

Greetings

Walter

JuliaDawkins
Member

Wonderful request! It is confusing to users when this feature works in VIEW but REPORT has different behavior. Seems like a low-effort charge!

panta1978
Member

That would be a feature I would really appreciate! The unexpected behaviour of DIAdem when I limit x-range is giving me a bad time. Any workaround is complicated and not so effective.