Configure a trend

Configure the source of the data to display in the Trend object. Add a pen for each data point to draw on the trend chart. When trending historical data from a database, a trend line is drawn between points when the logger is not capturing data.
  1. In
    Project view
    , right-click a node to contain the
    Trend
    object and select
    New
    Data controls
    Trend
    .
  2. In
    Properties
    , in
    Trend Mode
    , select either:
    • Normal
      . The default mode of trend charts. Navigate and zoom the trend chart.
    • Trace
      . Add time traces to the chart to mark significant data points.
    • Range
      . Select, move, and resize time ranges on the trend chart.
    TIP: Trend objects expose
    Clear time traces
    and
    Clear time ranges
    methods. To be able to remove time traces and time ranges from the trend chart, you can associate these methods with button events. For more information, see Add a method to an existing event.
  3. Create a dynamic link between
    Model
    and a node or database from which you want to obtain the data.
    For more information about dynamic links, see Create dynamic links.
    TIP: To configure the trend and trend pens for data logger data, from
    Project view
    , drop a data logger onto the trend in the editor. You can also drop the data logger onto the trend
    Model
    in
    Properties
    .
  4. (optional) Configure the trend properties:
    • Query
      . SQL query that filters the data. For more information about queries, see SQL queries.
    • Refresh time
      . Sampling time.
    • Reference time zone
      . Time zone of the date and time on the X-axis.
  5. Under
    Pens
    , associate
    TrendPen
    #
    with the pen data source.
    Data type
    Data source
    Real-time values of a specific variable
    Dynamic link to a variable.
    Real-time values sampled by a data logger
    Dynamic link to the
    Last value
    property of a Data logger.
    Historic values of variables stored in a database
    The name of the column of interest in a Database.
    Do not create a dynamic link to the column of interest in the Database. Provide the name of the column instead.
  6. (optional) Configure pen properties:
    • Thickness
      . Weight of the pen line.
    • Title
      . Pen title.
    • Color
      . Color of the pen line.
    • Enabled
      . Shows or hides the pen.
  7. (optional) To add a threshold to a pen, next to
    Thresholds
    , select
    Add
    and configure the
    Threshold
    #
    properties:
    • Value
      . Threshold line position on the Y-axis.
    • Color
      . Threshold line color.
    • Thickness
      . Threshold line thickness.
  8. (optional) To add a pen, next to
    Pens
    , select
    Add
    and repeat 5.
  9. (optional) Add a Y-axis by right-clicking a
    TrendPen
    and selecting
    YAxis
    .
    TIP: Adding more Y-axes to trend pens is useful for visualizing the same data in different scales. Control the scale by setting
    Maximum value
    and
    Minimum value
    properties.
  10. (optional) Configure the X-axis properties:
    • Interactive
      . Make the X-axis interactive at runtime.
      Applies only to the
      Normal
      Trend Mode
      .
    • Date and time
      . Date and time that displays in the X-axis at runtime. Defaults to the current time.
    • Snap position
      . If you specify
      Date and time
      , you can set the X-axis position to either:
      • Left
        . Displays the specified date and time on the left of the X-axis.
      • Right
        . Displays the specified date and time on the right of the X-axis.
      • Center
        . Displays the specified date and time in the center of the X-axis.
    • Follow
      . Scroll the X-axis automatically as time progresses at runtime.
    • Time window
      . Time interval shown by the trend (in milliseconds).
  11. (optional) Configure the Y-axes properties:
    • Automatic scaling
      . Scales the Y-axis at runtime based on the minimum and maximum values.
    • Interactive
      . Makes the Y-axis interactive.
    • Minimum value
      . Minimum value displayed on the Y-axis.
    • Maximum value
      . Maximum value displayed on the Y-axis.
  12. (optional) Add the
    Refresh
    method of the
    Trend
    object to an event.
    For example, associate the
    Refresh
    method with the
    MouseClick event
    of a
    Button
    object.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.