# Popup Trend views

**URL:** <https://forum.inductiveautomation.com/t/popup-trend-views/104115>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 24, 2025, 5:43pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115 "2025-03-24T17:43:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppricket1224](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@ppricket1224](https://forum.inductiveautomation.com/u/ppricket1224)\
**Post date:** [March 24, 2025, 5:43pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/1 "2025-03-24T17:43:07Z")

</div>

I have a customer that wants to be able to click on a numerical display to popup a trend chart on a screen in the vision module.  
They already have an Ad-Hoc trend screen but does not want to browse through tags to find the one they are looking for. They just want to look at the values on the screen and click on the problem value to view a trend chart.  
Is this something ignition can do, if so how can it be done?

Thank you

Paul

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 24, 2025, 5:44pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/2 "2025-03-24T17:44:24Z")

</div>

> [@ppricket1224](#):
>
> Is this something ignition can do

Yes this can be accomplished.

Does the customer have the TagHistory Module?

---

<div class="post-metadata">

**Author:** ![ppricket1224](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@ppricket1224](https://forum.inductiveautomation.com/u/ppricket1224)\
**Post date:** [March 24, 2025, 5:45pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/3 "2025-03-24T17:45:44Z")

</div>

Yes they do have the TagHistory module

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 24, 2025, 5:47pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/4 "2025-03-24T17:47:37Z")

</div>

In that case, then probably the simplest way to accomplish this is to insure the value is a tag, set it up to be recorded at an appropriate pace. Then using the EasyChart component on your pop-up, drag the tag onto the component.

---

<div class="post-metadata">

**Author:** ![ppricket1224](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@ppricket1224](https://forum.inductiveautomation.com/u/ppricket1224)\
**Post date:** [March 24, 2025, 5:57pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/5 "2025-03-24T17:57:56Z")

</div>

If i understand you correctly, my customer would open a popup window with a trend chart on it, then from one of there process screens drag a tag from it to the easy chart. I did not know you could drag tags from a screen like that.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 24, 2025, 6:04pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/6 "2025-03-24T18:04:03Z")

</div>

> [@ppricket1224](#):
>
> from one of there process screens drag a tag

No, you would do it for the tag in question in the designer. This would pre-configure the easy chart to display the tag.

> **[Vision - Easy Chart | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/vision-components/charts/easy-chart)**
>
> This component is used to make runtime-configurable time-series charts.

---

<div class="post-metadata">

**Author:** ![ppricket1224](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@ppricket1224](https://forum.inductiveautomation.com/u/ppricket1224)\
**Post date:** [March 24, 2025, 6:11pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/7 "2025-03-24T18:11:42Z")

</div>

No thats not what i'm looking for, that would mean making hundreds of preconfigured east charts for each data point. I want to be able to pass the trend information to the easy chart by clicking on the numerical value.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 24, 2025, 6:17pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/8 "2025-03-24T18:17:43Z")

</div>

You can.

You would just need to script it.

Then making the pop-up parametrized and passing in the tag path, you can write a script which would add that tag path to the `pens` dataset of the EasyChart.

I don't know enough about what you've got set up to give you a concrete example, but this is possible.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [March 24, 2025, 6:37pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/9 "2025-03-24T18:37:45Z")

</div>

Absolutely possible but only via a specific setup on your value displays and scripting. You would have to set up your value displays to be aware of the tag path they are using to fetch their value.

Then you would have to build a context menu with an option of sending that tag path to the trending popup. Or you could do some scripting with clicking on the value and dragging to the trending popup, but that may be more work.

We went the context menu route:

> **Create Trend Context**
>
> ![NewTrend1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/b/6bf1f79cc238ac6f2c53d77283eb4ed94eaf91c5.png)

Ignore the overlay on the popup, this is on our dev gateway and I'm partway through breaking things.

> **Trend window**
>
> ![NewTrend2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/23d98c085658b60efe67560e15374a58e7f1e094.png)

> **Trend Context with trend window open**
>
> ![NewTrend3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1d3f10e14137d45038590553107cdfd74838e9ac.png)

---

<div class="post-metadata">

**Author:** ![ppricket1224](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@ppricket1224](https://forum.inductiveautomation.com/u/ppricket1224)\
**Post date:** [March 24, 2025, 6:43pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/10 "2025-03-24T18:43:28Z")

</div>

Hi Ryan, that is the kind of thing im looking for. Is it alot of scripting to make that work.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [March 24, 2025, 6:54pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/11 "2025-03-24T18:54:55Z")

</div>

Building the submenu is a little confusing but the actual logic to get stuff to the window instance is pretty simple. The other chunk of scripting is to take the passed tagPaths and build the proper chart configuration dataset from them.

> **Context Menu Script**
>
> ```python
> from functools import partial
> 
> def addToTrend(event, selectedDataItem, window):
> """ Add selected data item to existing trend window """
> # Grab the existing list of trend items from the window root container:
> trendDataItems = window.rootContainer.trendItems
> 
> # Add the selected data item's path/id to the dataset
> newTrendItems = system.dataset.addRow(trendDataItems, row=[selectedDataItem])
> 
> # Put the new dataset back into the params for the window
> window.rootContainer.trendItems = newTrendItems
> 
> return
> 
> def openTrend(event, number, selectedDataItem):
> """ Open selected data item in a new trend window """
> # Create a new dataset with the selected data item path
> newTrendItems = system.dataset.toDataSet(['tagPath'], [[selectedDataItem]])
> 
> # Open a new instance of the trend window
> system.nav.centerWindow(
> system.nav.openWindowInstance("Path/To/Popup/Trend", {"trendId": number, "trendItems": newTrendItems}))
> 
> return
> 
> def buildAnalogValueContextMenu(event):
> """ """
> mainMenu, mainItems = [],[]
> 	
> subMenuA, subMenuB, windowIds = [], [], []
> 
> # Get a list of all opened trend windows
> openWindows = system.gui.findWindow("Path/To/Popup/Trend")
> 
> # Grab the tag path or some other id of the data we want to trend
> selectedDataItem = event.source.tagPath
> 
> for window in openWindows:
> if window.path == "Path/To/Popup/Trend":
> # Grab the popup window number from the window's parameters
> popupWindowNumber = window.rootContainer.trendId
> 
> # Add window id number to list so we can avoid collisions
> windowIds.append(popupWindowNumber)
> 
> #Create sub menus
> subMenuA = subMenuA + ["Trend %d" % popupWindowNumber]
> subMenuB = subMenuB + [partial(addToTrend, number=trendId, window=window, selectedDataItem=selectedDataItem)]
> 
> if len(windowIds) > 0:
> # Lazy collision avoidance, take largest number in the list and add 1
> newTrendWindowId = max(windowIds) + 1
> 	
> else:
> newTrendWindowId = 1
> 
> # Add option to create new trend popup
> subMenuA = subMenuA + ["New Trend"]
> subMenuB = subMenuB + [partial(openTrend, number=newTrendWindowId, selectedDataItem=selectedDataItem)]
> 
> # Pack menu and display popup menu
> subMenu = [subMenuA, subMenuB]
> 	
> mainMenu += ["Create Trend"]
> mainItems += [subMenu]
> 
> 	
> return system.gui.createPopupMenu(mainMenu, mainItems)
> 
> ```

Using the above project library functions I then made a template that is just the analog value display, that takes the tag path for the analog display.

On the template 'mouseClicked' handler I put:

```python
if event.button == event.BUTTON3:
	newMenu = path.to.project.library.package.buildAnalogDisplayContextMenu(event)
	newMenu.show(event, event.x, event.y)

```

I have pturmel's [Integration Toolkit](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934) installed so I'm able to make the required trend dataset using the following expression:

> **Trend Dataset Expression**
>
> ```python
> unionAll(
> asMap(
> "NAME", "str",
> "TAG_PATH", "str",
> "AGGREGATION_MODE","str",
> "AXIS","str",
> "SUBPLOT", "I",
> "ENABLED", "B",
> "COLOR", "clr",
> "DASH_PATTERN", "str",
> "RENDER_STYLE", "I",
> "LINE_WEIGHT", "F",
> "SHAPE", "I",
> "FILL_SHAPE", "B",
> "LABELS", "B",
> "GROUP_NAME", "str",
> "DIGITAL", "B",
> "OVERRIDE_AUTOCOLOR", "B",
> "HIDDEN", "B",
> "USER_SELECTABLE", "B",
> "SORT_ORDER", "I",
> "USER_REMOVABLE", "B"
> ),
> if(
> len({Root Container.trendItems}) > 0,
> forEach(
> {Root Container.trendItems},
> asMap(
> "NAME", split(it()['tagPath'], "/")[len(split(it()['tagPath'], "/"))-1, 0],
> "TAG_PATH", "[ProviderName]" + if(
> len(split(it()['tagPath'], "]")) > 1,
> lower(split(it()['tagPath'], "]")[1,0]),
> it()['tagPath']
> ) + "/pv",
> "AGGREGATION_MODE", "MinMax",
> "AXIS", "Default Axis",
> "SUBPLOT", 1,
> "ENABLED", True,
> "COLOR", color(175, 255, 25),
> "DASH_PATTERN", "",
> "RENDER_STYLE", 1, 
> "LINE_WEIGHT", 1.0,
> "SHAPE", 0,
> "FILL_SHAPE", True,
> "LABELS", False,
> "GROUP_NAME", "",
> "DIGITAL", False,
> "OVERRIDE_AUTOCOLOR", False,
> "HIDDEN", False,
> "USER_SELECTABLE", True,
> "SORT_ORDER", None,
> "USER_REMOVABLE", False
> )
> ), asList()
> )
> )
> 
> ```

Otherwise, you'll need to make an additional project library function to take the single column dataset `trendItems` from the trend popup root container and transform it into the required dataset for the trend chart.

The required properties on the trend popup for my script to work are `windowId` of string type, `trendItems` of dataset type, and `trendId` of integer type.

Edit:Found it [Passing New Parameters to an Existing Popup Window - Vision](https://forum.inductiveautomation.com/t/passing-new-parameters-to-an-existing-popup-window-vision/87864).

---

<div class="post-metadata">

**Author:** ![ppricket1224](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@ppricket1224](https://forum.inductiveautomation.com/u/ppricket1224)\
**Post date:** [March 24, 2025, 7:02pm UTC](https://forum.inductiveautomation.com/t/popup-trend-views/104115/12 "2025-03-24T19:02:14Z")

</div>

Thank you again Ryan, this is a big help. I will study what you have sent here and make something work for my needs.
