# Show tooltipText in foreground of the Status Chart - Vision

**URL:** <https://forum.inductiveautomation.com/t/show-tooltiptext-in-foreground-of-the-status-chart-vision/69084>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 27, 2023, 8:08am UTC](https://forum.inductiveautomation.com/t/show-tooltiptext-in-foreground-of-the-status-chart-vision/69084 "2023-01-27T08:08:19Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [February 21, 2023, 1:54am UTC](https://forum.inductiveautomation.com/t/show-tooltiptext-in-foreground-of-the-status-chart-vision/69084/8 "2023-02-21T01:54:20Z")

</div>

Looking at this, it looks a little silly to me displaying elapsed time in seconds over timespans that cover days or even weeks, so remembering [a function I recently developed for summing timespans in power tables](https://forum.inductiveautomation.com/t/display-sum-of-a-column-at-the-end-of-the-table/68717/6), I figured it could be easily applied to this as well. **If the following function is added to the above script:**

```auto
def format_time(timestamp):
	days = int(timestamp / 86400)
	hours = int((timestamp % 86400) / 3600)
	minutes = int((timestamp % 3600) / 60)
	seconds = int(timestamp % 60)
	output = []
	if days > 0:
		output.append(str(days) + 'd')
	if hours > 0:
		output.append(str(hours) + 'h')
	if minutes > 0:
		output.append(str(minutes) + 'm')
	if seconds > 0:
		output.append(str(seconds) + 's')
	return ' : '.join(output) if output else '0s'

```

**and the** `timeDiff = ` **line is changed from** `str((float(endDate) - float(startDate)) / 1000)` **to** `format_time((float(endDate) - float(startDate)) / 1000)`

**The result will look like this:**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/77a1ccd12869d5d938c895ff5bd6f72038ba3a3e.png)

**Edit:** added missing return statement to function

---

_[View the full topic](https://forum.inductiveautomation.com/t/show-tooltiptext-in-foreground-of-the-status-chart-vision/69084)._
