timestamp as x axis lazarus / 55-TAChart ---------------------------------------------------------------------- bagofmoes · 2015-10-25 11:48 hello, okay so I'm working on this project. I have a list of temperature values with timestamps. for now I got an array with Trecord of timestamp:string, value:integer; I want to display the values in a graph with corresponding timestamp. so the problem is that the TAChart doesn't have a utility to use timestamps in a graph. ( as far as I could find). I can convert the timestamp to any sort.. but I have no idea how to make a nice graph with it. I thought I could make a float with year+month+day+ ','+hour+min+sec. I haven't implemented this yet, but hours only go to 24 and minutes and seconds go to 60 so this would make a really strange graph. plus the x-axis would look really ridiculus. I also considered using unix time for the x-axis and then convert the first and last value visible on the chart to a understandable timestamp and put these over the x-axis so the unix time wouldn't be visible anymore. I'm not so sure if that would work properly though. I hope you have some good idea's for me. And I hope most of all that I just overlooked a function that could use a timestamp in the TAChart. thanks in advance! ---------------------------------------------------------------------- wp · 2015-10-25 12:04 If I understand correctly your timestamp is a string. This is not very favorable. When you get your data, don't store the times as strings but as proper TDateTime variables (i.e. floating point numbers). Use the "ScanDateTime" funtion of unit DateUtils for conversion. Then add a TDateTimeIntervalChartSource to the form and assign it to the "Source" property of the x axis. TDateTimeIntervalChartSource is a bit clumsy if you have special requirements regarding label positioning, but does a good job in most cases. Feel free to ask further questions. ---------------------------------------------------------------------- bagofmoes · 2015-10-25 12:09 thank you for your quick reply! I have no idea that TDateTimeIntervalChartSource (thats a really long name haha) existed. I also don't have any experience with chartsources yet. no need to explain the chartsource, but it could take a while before I'll post a new message. thanks! ---------------------------------------------------------------------- wp · 2015-10-25 12:15 To get yourself started you should have a look at the documentation - see section http://wiki.lazarus.freepascal.org/TAChart_documentation#Date- time_interval_source for the DateTimeIntervalChartSource. There is also a bunch of tutorials, none for Date/time axes, though. ---------------------------------------------------------------------- bagofmoes · 2015-10-25 13:39 wow, getting started is suprisingly easy! thanks for your support!