Perspective XY Chart tooltip calculated value

Hi guys, I have a Perspective project with a XY chart that represents seconds on the Y axys of some events that happen on the plant.
What I wish is to display in the tooltip the seconds like HH:mm:ss, for example if the value is 3600 seconds, the tooltip should represent 01:00:00.
I have a script that generates the trendStyle but I can't reach this goal.


I spent quite a while figuring out how to beat the XY Chart tooltips into shape. I documented it all on the forum. Read through it and you might find a solution.

1 Like

Thanks @Transistor I fixed. Now I have another problem with tooltip position. As you can see, if I hover on a bullet line, the tooltip goes over the container and it is "cutted". Is there a way to show the complete tooltip independently of the bullet position?


Possible workarounds:

  1. Force yAxes.0.value.range.max to a higher value to open up a little space. This breaks your auto-scaling.
  2. Add style.paddingTop : 40 (or whatever).

Solved showing only few values that fits in the tooltip. Another question: is there a way to hide yAxis when clicking on a trend legend? I would like to show/hide yAxis based on trend legend

No, I don't think any of those properties are exposed.

Workaround: create your own legends outside the chart with checkboxes or toggle switches and bind each yAxes.x.visible to the boolean tags.

Another possibility is to use labels for the legends and use onMouseEnter and onMouseLeave to enable the visibility. Watch out for reliability issues if the onMouseLeave event doesn't fire for any reason. (I don't know why I suspect this might be a problem. Just a hunch.)

1 Like