Selecting/Deselecting Multiple pens in groups of Easy Chart

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!

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
Eash Chart Customizer

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.

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.

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.

2 Likes

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:

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)
3 Likes

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?

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.

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

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

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

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.

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

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

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

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?

Hello!

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

regards

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.

2 Likes

image

3 Likes

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

thank you very much

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.

1 Like