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.
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?
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.
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.
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]