# Status chart getToolTipText custom string

**URL:** <https://forum.inductiveautomation.com/t/status-chart-gettooltiptext-custom-string/17434>\
**Category:** Ignition\
**Created:** [March 20, 2018, 10:25am UTC](https://forum.inductiveautomation.com/t/status-chart-gettooltiptext-custom-string/17434 "2018-03-20T10:25:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanko25](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vanko25](https://forum.inductiveautomation.com/u/vanko25)\
**Post date:** [March 20, 2018, 10:25am UTC](https://forum.inductiveautomation.com/t/status-chart-gettooltiptext-custom-string/17434/1 "2018-03-20T10:25:31Z")

</div>

Hi all,  
I am trying to return a custom tooltip on my statuschart with the following piece of code in the getToolTipText() extension function but it does return the default tool tip.

`import system
	startDate = system.date.fromMillis(selectedTimeStamp)
	endDateCalc = self.selectedTimeStamp + self.timeDiff
	endDate = system.date.fromMillis(endDateCalc)
	customString = (startDate,endDate,selectedStatus)
	return customString
`

If I get rid of all the lines and leave the lines as below it works but the date is not really readable.

```auto
 customString = (selectedTimeStamp,timeDiff,selectedStatus) 
```

Could you point me in the right direction, please? Thanks!

---

<div class="post-metadata">

**Author:** ![vanko25](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vanko25](https://forum.inductiveautomation.com/u/vanko25)\
**Post date:** [March 20, 2018, 11:13am UTC](https://forum.inductiveautomation.com/t/status-chart-gettooltiptext-custom-string/17434/2 "2018-03-20T11:13:44Z")

</div>

Got it working by myself. The time in the getToolTopText() is in seconds from the epoch and I needed milliseconds to convert to date so just needed to multiply by 1000 and convert the number to long. Here is the code if anyone needs it:

```auto
startDateMillis = long(selectedTimeStamp * 1000)
endDateMillis = long(timeDiff * 1000)
endDateCalc = startDateMillis + endDateMillis
startDate = system.date.fromMillis(startDateMillis)
startDateFormatted = str(system.date.format(startDate, "dd/MM/yyyy HH:mm:ss"))
endDate = system.date.fromMillis(endDateCalc)
endDateFormatted = str(system.date.format(endDate, "dd/MM/yyyy HH:mm:ss"))
customString = (startDateFormatted,endDateFormatted,"Machines running:",selectedStatus)
return customString
```
