# Perspective XY Chart DurationOn ms to Hours

**URL:** <https://forum.inductiveautomation.com/t/perspective-xy-chart-durationon-ms-to-hours/98063>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 1, 2024, 7:58pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-durationon-ms-to-hours/98063 "2024-11-01T19:58:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timothy\_Vertin](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@Timothy\_Vertin](https://forum.inductiveautomation.com/u/Timothy_Vertin)\
**Post date:** [November 1, 2024, 7:58pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-durationon-ms-to-hours/98063/1 "2024-11-01T19:58:12Z")

</div>

Ignition Version 8.1.43

Hey there, my first post, and new user with the Ignition platform. I am using an XY Chart to display how long a bool (process state) has been true from a Canary Data historian. I have the historical data sources for each of the chart series properly set and aggregations are working. The issue is, the durations (y-axis) are being displayed in milliseconds and would like to have the durations displayed in hours. Please see the screenshot below....

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

I don't know where to begin on where to perform the appropriate math to convert from milliseconds to hours. Any help on where to do this in the chart configuration would be much appreciated. Thank you in advance for your help!

Regards,

Tim

---

<div class="post-metadata">

**Author:** ![Timothy\_Vertin](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@Timothy\_Vertin](https://forum.inductiveautomation.com/u/Timothy_Vertin)\
**Post date:** [November 6, 2024, 5:15pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-durationon-ms-to-hours/98063/2 "2024-11-06T17:15:36Z")

</div>

I was able to find a script in another post and use it as a guide for my math. It is working but returning integers, I would like it to return floats in the value column. I have not determined the right approach for this yet. Any help on getting floats into the value field would be much appreciated. Thank You!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/e/5e017617ebd92cca2481c71eb065854100937dfa.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a3d93f9aff91046d70f65097875f7396bb533a01.png)

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [November 6, 2024, 5:34pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-durationon-ms-to-hours/98063/3 "2024-11-06T17:34:16Z")

</div>

When you set convertedData to value, its going to use the types as they are. Use [DatasetBuilder (ignition 7.9.5 API)](https://files.inductiveautomation.com/sdk/javadoc/ignition79/795/com/inductiveautomation/ignition/common/util/DatasetBuilder.html) to define your types instead.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 6, 2024, 5:34pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-durationon-ms-to-hours/98063/4 "2024-11-06T17:34:36Z")

</div>

Welcome to the forum, Timothy. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831). It helps when we want to edit your code into our answers.
