Linking to a Trend (4.3.1)

This article applies to versions 4.3.1-4.5.1 of P2 Explorer. For the latest, see Linking to a Trend.

P2 Explorer allows you to link to a trend via a URL. There are 2 ways of doing this:

  • Sharing a link to a trend through the P2 Explorer framework.
    You can link to a saved trend or a blank trend. 
  • Creating a dynamic trend by manually entering a URL.

Security considerations

  • When you share a saved trend, it will only be visible to people who have permission to view the workspace in which it is saved. 
  • People who do not have permission to view the included tags or attributes will not be able to view data for those tags or attributes.

Related: Linking to a Page


Option 1. Sharing a link through Explorer

The simplest way of linking to a trend is by clicking the Share Link shareicon button on the Trend ribbon tab. This allows you to share the current state of a trend at any time (i.e. with the current selected options such as time range, sample interval, etc).

When a user clicks a link shared this way, the trend will either open in a tab inside the P2 Explorer framework, or as a separate tab in the browser.

Share trend link

When the Share Trend dialog box opens, you can simply copy and paste the URL into an email, or wherever you intend to use it.

Note: People who do not have permission to view the included tags or attributes will not be able to view data for those tags or attributes.

How the link is constructed

Saved trends are constructed differently to blank trends.

Saved Trends

When a trend is saved, it is assigned a unique number (called a GUID) that identifies the trend. The GUID is represented with a long sequence of letters and numbers. E.g. /Guid/5a594800-c01f-4f8f-a184-b390317842e6

The number after the GUID (e.g. /5) represents the current state of the trend, which is saved in the database with an incrementing ID every time this dialog box is opened. 

Share saved trend

You will notice the Frameless URL check box is automatically selected. This automatically appends ?frameless to the URL, which forces the link to open outside of the P2 Explorer framework (frameless). Frameless means that only the trend is displayed; there is no header or ribbon. If you want the URL to open within the Explorer framework, clear this check box.

Blank Trends

You can also share a trend that has not been saved - this is often called a "dynamic trend". Blank trends can be shared with anyone (tag permissions apply). 

Blank trends do not have a GUID, rather they are identified by the state of the trend's variables, represented by the number after the trend (e.g. /8). This number is saved in the database with an incrementing ID every time this dialog box is opened. 

Share blank trend link


Option 2. Dynamic trend via URL

You can choose to share a dynamic trend via a URL, which uses a list of variables to specify the tags on the trend and the state of the options. This allows you to link to a trend with certain options already selected, such as time range, sample interval, etc.

How the URL is constructed

The standard format of the trend URL is as follows:

[Explorer URL]/trend?[variable list]&frameless

To use a variable in the URL, add a question mark ? followed by the list of variables in the format variable name=variable value. Separate multiple variables with &

Example:

https://perauthor01.petroleumplace.com/P2.Explorer/trend?
startTime=2014-11-01T00:00:00&endTime=2014-12-01T00:00:00

If you want the trend to be frameless, append &frameless after the list of variables.

Example:

https://perauthor01.petroleumplace.com/P2.Explorer/trend?
startTime=2014-11-01T00:00:00&endTime=2014-12-01T00:00:00&frameless

 


Variable Parameters

This table lists the available variables and how to use them. The variables correspond with various controls available on the trend.

Note: The URL parameters are case-sensitive. 

Variable Format/Options
endTime

Format: UTC or string. For a full list of string formats, see sugarjs.com/dates or sugarjs.com/date_formats.

Example (UTC): endTime=2014-12-01T00:00:00
Example (String): endTime=last month

Related control:

Trend end time control

startTime

Format: UTC or string. For a full list of string formats, see sugarjs.com/dates or sugarjs.com/date_formats.

Example (UTC): startTime=2014-11-01T00:00:00
Example (String): startTime=now

Related control:

Trend start time control

sampleMethod

Options are: Average, LinearInterpolate, LastKnownValue, Raw

Example: sampleMethod=LinearInterpolate

Note: Previously named topSampleMethod in Explorer 4.3.0

Related control:

Trend sample method control

sampleInterval

Format: Number of seconds

Note: The number of seconds must correspond to one of the options available in the related trend control.

Options are: 

Seconds Corresponds to this Sample Interval
1 1 second
5 5 seconds
10 10 seconds
30 30 seconds
60 1 minute
300 5 minutes
600 10 minutes
1800 30 minutes
3600 1 hour
21600 6 hours
43200 12 hours
86400 1 day
604800 1 week
1209600 2 weeks
2419200 4 weeks

Example: sampleInterval=3600

Note: Previously named topSampleInterval in Explorer 4.3.0

Related control:

Sample Interval on Trend

scaleType

Describes the way the points are distributed in the y-axis direction.

Options are: Linear, Log

Example: scaleType=Linear

Related control:

Trend scale type control

interpolationType

Specifies the line drawing algorithm to use to join the data points up.

Options are: Linear, Log

Example: interpolationType=Linear

Related control: There is no specific control that relates to this parameter.

hairlineMode

Specify how many hairlines should be allowed.

Options are: None, Single, Dual, Multiple

Example: hairlineMode=Single

Related control:

Trend hairlines control

isNow

Sets the end time time of the traces to the current time. When this is selected, two additional parameters are available: duration and refreshRate.

Options are: True, False

Example: isNow=True

Related control:

Trend Now control

refreshRate

Defines the rate at which the trace is refreshed, when the time is set to "Now". Only applies when isNow=True.

Format: Number of seconds

Note: The number of seconds must correspond to one of the options available in the related trend control.

Options are: 60, 300, 1800

Example: refreshRate=60

Related control:

Trend refresh rate control

duration

Defines the time period over which to plot the data. Only applies when isNow=True.

Format: Number of seconds

Note: The number of seconds must correspond to one of the options available in the related trend control.

Options are: 

Seconds Corresponds to this Sample Interval
43200 12 hours
86400 24 hours
432000 5 days
604800 1 week
1209600 2 weeks
2592000 1 month
5184000 2 months
7776000 3 months
15552000 6 months
31536000 1 year
63072000 2 years

Example: duration=43200

Related control:

Trend duration control

showControls

Shows or hides the trend's control strip:

Trend controls

Options are: True, False

Example: showControls=True

Related control:

Trend controls button

showRangeSelector

Shows or hides the trend's range selector:

Trend range selector

Options are: True, False

Example: showRangeSelector=True

Related control:

Trend range selector button 

showTraceTable

Shows or hides the trend's trace table.

Trend trace table

Options are: True, False

Example: showTraceTable=True

Related control:

Trend trace table button

tags

The comma separated list of tags to show in the trace. Each tag name must be enclosed in curly brackets {}.

Format: Tag name
Example (single tag): tags={PIPERPV01.001}

To specify a list of tags, use tags=tag1,tag2 etc
Example (multiple tags): tags={PIPERPV01.001},{PIPERPV02.001}

selectedEntities

The comma separated list of entities to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. The URL won't work if these parameters are used in isolation. When using these parameters, selectedEntities and attributes are both required.

Format: Entity name
Example (single entity): selectedEntities=Anstey

To specify a list of entities, use selectedEntities=entity1,entity2 etc
Example (multiple entities): selectedEntities=Anstey,Archer

Note: This variable was introduced in Explorer 4.4.1

templates

The comma separated list of templates to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. The URL won't work if these parameters are used in isolation. If template is omitted, the entity's primary template will be used.

Format: Template name
Example (single template): templates=Region

To specify a list of templates, use templates=template1,template2 etc
Example (multiple templates): templates=Region,Area

Note: This variable was introduced in Explorer 4.4.1

attributes

The comma separated list of attributes to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. The URL won't work if these parameters are used in isolation. When using these parameters, selectedEntities and attributes are both required.

Format: Attribute name
Example (single attribute): attributes=Choke

To specify a list of attributes, use attributes=attribute1,attribute2 etc
Example (multiple attributes): attributes=Choke,Temperature

Note: This variable was introduced in Explorer 4.4.1 

attributeValues

The comma separated list of attribute values to show in the trace.

Note: The URL parameters selectedEntities, templates, attributes, and attributeValues are all designed to be used together. The URL won't work if these parameters are used in isolation. If attributeValue is omitted, the default value of the attribute will be used.

Format: Attribute value name
Example (single attribute value): attributeValues=Actual

To specify a list of attribute values, use attributeValues=attributevalue1,attributevalue2 etc
Example (multiple attribute values): attributeValues=Actual,Planned

Note: This variable was introduced in Explorer 4.4.1 

 

Leave a Reply

Your email address will not be published. Required fields are marked *