# Selecting/Deselecting Multiple pens in groups of Easy Chart

**URL:** <https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161>\
**Category:** Ignition\
**Created:** [March 8, 2019, 3:28pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161 "2019-03-08T15:28:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_hanson](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@p\_hanson](https://forum.inductiveautomation.com/u/p_hanson)\
**Post date:** [March 8, 2019, 3:28pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/1 "2019-03-08T15:28:33Z")

</div>

I have a crowded chart and have grouped multiple pens together for organization; pumps, pressure, temp, etc. I’d like to be able to select or deselect those groupings of pens with a single button. Can anyone provide suggestions? I looked through the forum, but didn’t find anything helpful. Also, I don’t see in the manual where it identifies all properties of the easy chart that I could use within scripting.

Thanks in advance!

---

<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 8, 2019, 3:42pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/2 "2019-03-08T15:42:29Z")

</div>

I would start off by reading the Advanced Configuration section in the manual. You might also want to look through the Easy Chart Customizer section also.

[Easy Chart](https://docs.inductiveautomation.com/display/DOC79/Easy+Chart)  
[Eash Chart Customizer](https://docs.inductiveautomation.com/display/DOC79/Easy+Chart)

The Easy Chart section also lists all of the properties for the object, these can all be accessed through scripting.

Of specific interest to you, I would think, should be the Dynamic Configuration which describes the basic process of what I think it is that you are wanting, I’m just not sure I know exactly what that is.

Needless to say, it is possible to modify the Pens displayed dynamically at runtime.

---

<div class="post-metadata">

**Author:** ![p\_hanson](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@p\_hanson](https://forum.inductiveautomation.com/u/p_hanson)\
**Post date:** [March 8, 2019, 5:17pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/3 "2019-03-08T17:17:10Z")

</div>

I’ve reviewed all of the above, there is no mention of a property to select or deselect a pen. There is a property which allows the user to select or not select a pen. But, this only refers to the ability for the user to select a pen; not the actual selection of the pen itself.

What I’m looking for is a way for the user to select or deselect groups of pens (multiple pens) at the same time.

Below you can see a snip of my chart showing the available pens. I would like to give the user the ability to turn all pens in the group “Pressure” off or on.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d4d0354ee2c8bd7556e3ff4f64eda7a9b4f142a7.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 8, 2019, 6:14pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/4 "2019-03-08T18:14:18Z")

</div>

You have to add your own buttons and script the changes to the “enabled” column of either the `pens` or `tagPens` properties’ datasets. You’ll probably want to hide the built-in checkboxes.

---

<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 8, 2019, 7:05pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/5 "2019-03-08T19:05:32Z")

</div>

In addition to what Phil says, you could loop through the appropriate dataset and filter for the proper group name, enabling only those pens.

Something like:

```auto
chart = event.source.parent.getComponent('Easy Chart')

for pen in range(chart.tagPens.rowCount):
	gName = chart.tagPens.getValueAt(pen,'Group_Name')
	if gName == 'Pump':
		chart.tagPens = system.dataset.setValue(chart.tagPens,pen,'Enabled',1)
	else:
		chart.tagPens = system.dataset.setValue(chart.tagPens,pen,'Enabled',0)

```

---

<div class="post-metadata">

**Author:** ![IA2019](https://avatars.discourse-cdn.com/v4/letter/i/e56c9b/32.png) [@IA2019](https://forum.inductiveautomation.com/u/IA2019)\
**Post date:** [May 3, 2019, 1:58pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/6 "2019-05-03T13:58:27Z")

</div>

Hi p\_hanson, were you able to perform this function?

Can someone please advise, I am trying to peform the same thing ie, selecting and deselecting multiple pens. All I have is bunch of pens on easy chart (inbuilt function). What should be my first step?

---

<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:** [May 6, 2019, 11:47am UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/7 "2019-05-06T11:47:20Z")

</div>

As @pturmel and I laid out you’ll need to add your own buttons and script which changes the enabled column of the appropriate dataset for your pens. Depending on if you have them grouped or not you may not need to filter by group name.

---

<div class="post-metadata">

**Author:** ![Vaishnavi.V](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@Vaishnavi.V](https://forum.inductiveautomation.com/u/Vaishnavi.V)\
**Post date:** [April 20, 2021, 10:22am UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/8 "2021-04-20T10:22:41Z")

</div>

Hi @pturmel .I would like to know how can we access and hide the built-in checkboxes.Thanks in advance

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 20, 2021, 11:36am UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/9 "2021-04-20T11:36:44Z")

</div>

The checkboxes are not exposed for access. I suppose you could dig through the java component hierarchy to find and manipulate them, but I’ve never done that. You can hide them entirely with the “Pen Control?” setting.

[https://docs.inductiveautomation.com/display/DOC81/Vision+-+Easy+Chart](https://docs.inductiveautomation.com/display/DOC81/Vision+-+Easy+Chart)

---

<div class="post-metadata">

**Author:** ![Vaishnavi.V](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@Vaishnavi.V](https://forum.inductiveautomation.com/u/Vaishnavi.V)\
**Post date:** [April 20, 2021, 11:46am UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/10 "2021-04-20T11:46:57Z")

</div>

How to access the pen labels atleast. I would like to display a unique tooltiptext when I hover over each pen in the pencontrol panel.Kindly help me out

---

<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:** [April 20, 2021, 12:02pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/11 "2021-04-20T12:02:06Z")

</div>

Honestly, it is much easier to hide the pen control and then make your own pen control which you can then add the tool tips to, particularly if the pens wont be changing dynamically.

---

<div class="post-metadata">

**Author:** ![Vaishnavi.V](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@Vaishnavi.V](https://forum.inductiveautomation.com/u/Vaishnavi.V)\
**Post date:** [April 20, 2021, 12:17pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/12 "2021-04-20T12:17:02Z")

</div>

So there is no way to access the pen labels then ?

---

<div class="post-metadata">

**Author:** ![Vaishnavi.V](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@Vaishnavi.V](https://forum.inductiveautomation.com/u/Vaishnavi.V)\
**Post date:** [April 20, 2021, 12:20pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/14 "2021-04-20T12:20:41Z")

</div>

I tried digging through the java components , but could not access the checkbox or the color changer in the jpanel.Any help would be appreciated . thank you

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 20, 2021, 12:29pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/15 "2021-04-20T12:29:59Z")

</div>

If you aren’t comfortable digging through the java component hierarchy, then @lrose’s suggestion is the correct approach.

For the java internals, start here:

[https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.0/com/inductiveautomation/factorypmi/application/components/PMIEasyChart.html](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.0/com/inductiveautomation/factorypmi/application/components/PMIEasyChart.html)

---

<div class="post-metadata">

**Author:** ![Vaishnavi.V](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@Vaishnavi.V](https://forum.inductiveautomation.com/u/Vaishnavi.V)\
**Post date:** [April 20, 2021, 12:33pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/16 "2021-04-20T12:33:39Z")

</div>

I was able to access the jpanel using the hierarchy.But the jpanel in return has no components while there are color changer and check box still present in the jpanel.How to figure this out?

---

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [May 8, 2023, 2:05pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/17 "2023-05-08T14:05:30Z")

</div>

Hello!

How can I make this same route but for the database pens?

regards

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 8, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/18 "2023-05-08T14:29:27Z")

</div>

The approach @lrose suggested applies to both historian pens (runtime altering the `.tagPens` property) and to database pens (runtime altering the `.pens` property). The two configuration datasets are very similar.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [May 8, 2023, 2:32pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/19 "2023-05-08T14:32:54Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/314a1f699073fafa6bcd1d2d6768892d8000eb24.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fdb2db24701d0d1d91ad68f69dd5b27adb8421d7.png)

---

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [May 8, 2023, 3:05pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/20 "2023-05-08T15:05:19Z")

</div>

> [@lrose](#):
>
> `chart.tagPens.rowCount`

ah ok, thanks a lot Phil, the only thing was to replace chart.tagPens.rowCount by chart.pens.rowCount

thank you very much

---

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [May 8, 2023, 3:06pm UTC](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161/21 "2023-05-08T15:06:42Z")

</div>

I didn't know that with the mousover I could see the script property! good to know that, thank you very much again and sorry for the silly questions hehehe I'm a bit new to this.

[Next page](https://forum.inductiveautomation.com/t/selecting-deselecting-multiple-pens-in-groups-of-easy-chart/23161.md?page=2)
