Power Chart - Different Pen Names

Could you please help me with the Power Chart?
Do you know, if is it possible to change Pen Name inside the table below when at least one tag is selected? Instead of the name of the tag, we would like to see the whole tag path.

Will be grateful for the help!

Yes, you can change it.


1 Like

Thank you! However, this work when a tag is selected already, and we can do that manually. But is it possible that set up somewhere that in this table automatically will the tagPath instead of tag Name?

That is the name it picks up automatically. You would have to do some scripting to get the name you want. The output should contain the dictionary for "pens".

There are ideas to make the tool better.
Increase usability of the Perspective Power Chart component

I would say it's quite hard because everyone is doing it in a different way.

Have a look at this:
Tag Historian Viewer

I haven't used it myself but you could make many static configurations with the correct names and save them.

It isn't really possible, unless you choose to use a separate component to select the tags to add as pens and write the script to add them.

Can I ask why? I find that for the uninitiated the historical tag path is just a bunch of gibberish, what users tend to want is the actual Tag Name because, generally, it should describe what the value actually is. I doubt that you're users really care what history provider and tag provider are used to store the history.

That's actually the case on why I see it difficult for Inductive Automation to make an unified tool for Power Charts. Some clients can understand tags, some want a short description, long description, tag path, etc, etc.

In this case, the source contains the tag, so it's possible to copy paste and remove what is not needed.
@Karyna_Moroz mentioned that they can do that manually but they are looking for an easier way.

@lrose Have you tried that Exchange Resource?

I have not, but then, I built our charting component before that resource was published. It does essentially the same thing as that resource does, probably a few more things as well, including using part of the tag path pen name.

We do this because we have several similarly named tags that can't really be differentiated at the Tag Name level so it is needed to add a little more context. I get that there are legitimate reasons, but I can't see a typical (non-designer) user ever needing or caring about the full tag path.

I think they just picked the tag or tag path as a first solution for building a chart with different names.

On a version 2.0 of the same project or for a another project the next question would be "How do we give it a nice name?" and then they will decide whether it is worth building their own tool/structure for it or just continuing to do it manually.

Hello everybody,

Thank you for all your answers. We have found the solution, please find its description below.

We have solved this by adding an onChange script on the pens property.
In the script, we are extracting the tag path from the source of the pen, then assigning that to the pen name.

1 Like

Would you mind sharing this script with me, please?

Edit: Nvm, found it. Add a change script on the pens prop and use the script below

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
if len(self.props.pens) > 0:
for i in range(len(self.props.pens)):
parts = self.props.pens[i].data.source.split(':')
self.props.pens[i].name = parts[-1]

1 Like

Does exactly what I was looking for. Thank You. :pray:

1 Like