4 Replies Latest reply on Jun 23, 2015 8:17 AM by Argel

    Single Scale to Multiple Scales and vice versa.

    Argel

      Do you know any VBA Code in Processbook to change a trend from Single Scale to Multiple Scales and vice versa? Thanks!

        • Re: Single Scale to Multiple Scales and vice versa.
          Eugene Lee

          Yes Argel. Take a look at this property from the Trend class.

           

          Trend MultipleScales Property

          The MultipleScales property is a Boolean property that determines whether all the traces of the plot use the same vertical scale or not. It serves the same function as the Single Scale and Multiple Scales option buttons in the Trend Definition dialog.

          Format

          object.MultipleScales = Boolean

          Returns

          Return type is boolean.

          Notes

          If TRUE, a separate upper and lower limit for the Y axis for each trace in the trend is displayed. If FALSE, all traces are plotted against the same Y axis upper and lower limits.

          If this property is set to TRUE, the current settings of Trend.ScaleMax and Trend.ScaleMin are used for all traces. If this property is set to FALSE, then each trace acquires the current setting of Trend.ScaleMax and Trend.ScaleMin as a starting value subject to subsequent changes.

          • Re: Single Scale to Multiple Scales and vice versa.
            Rhys Kirk

            Very simple example...use the "DataPoint" property to check what the data point for the trace to assign the appropriate scale...

             

            Sub ChangeScales()
            
            
            Dim t As Trend, bSingle As Boolean: bSingle = False
            Set t = Symbols("Trend1")
            
            
            If bSingle Then
                t.MultipleScales = False
            Else
                t.MultipleScales = True
                Dim iTrace As Integer
                For iTrace = 1 To t.TraceCount
                    t.CurrentTrace = iTrace
                    t.SetTraceScale 0, 100
                Next iTrace
            End If
            
            
            Set t = Nothing
            

             

            End Sub