Skip to main content
Version: 8.1

Easy Chart - Database Pens

Database Pens​

Database Pens are driven by a SQL query, so they are ideal to use when trending Transaction Group data. However, they can query for data in any connected SQL database, so it is possible to show historical data recorded by other systems on the Easy Chart.

This section assumes that Tags and Tag History have been configured

To learn more, go to the Tag and Configuring Tag History pages. The examples below use OPC PC Tags from the Programmable Device Simulator driver, but Memory Tags can be used instead.

Configuring Database Pens​

In this example, we'll configure a database pen driven by a SQL query to show historical data and display it on the Easy Chart.

  1. Drag an Easy Chart component onto your Vision window.

  2. Right click on the Easy Chart component and choose Customizers > Easy Chart Customizer.

  3. In the Database Pens section, we'll create a database pen to trend data stored in our database. Click the Add icon to create the Database Pen.

  4. The Edit Pen window will open. Here is where you enter your database pen data. In the very least, we'll need values for the following properties:
    We entered the following settings:

    1. Name - The name of the pen on the chart. Works the same as the name on any other pen.
    2. Datasource - The name of the database connection (as configured on the gateway) that contains the table we want to extract values from.
    3. Table Name - The name of the database table that contains the values that we want to represent on the chart.This dropdown will automatically populate with available table names once the Datasource property has a valid database selected.
    4. Value Column - The name of the column in the database table that contains the values we want to show, representing the value of the datapoint at a particular time. This column is ultimately responsible for the determining where each point lies on the chart's Y-axis. This dropdown will automatically populate with column names once a value for the Table Name property has been set.
    5. Time Column - The name of the column in the database table that contains a timestamp, representing the time of the datapoint. This column is ultimately responsible for determining where each point lies on the chart's X-axis. This dropdown will automatically populate with column names once a value for the Table Name property has been set.
    6. Axis - All pens require an axis. We can use the default here.

    Click OK to save your database pen settings.

  5. In the Database Pens area, you will see your database pen that you created. Click OK to exit the customizer and view your Easy Chart.

  6. The High Temp database pen is now trending data for the High Temp values we want to show at a selected time.