Chart recording[solved] lazarus / 55-TAChart ---------------------------------------------------------------------- mica · 2015-12-07 22:39 Im setting up a Raspberry Pi with some DS1820 Temp Sensors. Now i want to display last 24 h values with TAChart in a 6 h range which is auto scrolling. Is this easy doable or ist TAChart too complex and its easier to handcraft the graph? ---------------------------------------------------------------------- wp · 2015-12-07 22:59 Shouldn't be a problem. Just ask here if you have difficulties. Quote"Now i want to display last 24 h values with TAChart in a 6 h range which is auto scrolling."Does this mean that the chart contains always the last 24 hours and you only want to see the last 6 hours, but you want to be able to scroll back to the beginning of the 24 hours? (You can use a TCharNavScrollbar to achieve this, for example). What happens with data older than 24 hours? Are they dropped from the chart? At which time interval will you get the temperatures? ---------------------------------------------------------------------- fpcoder · 2015-12-08 00:17 Might not be the case, but if we assume that the data is stored in a SQL database, TDBChartSource could be used for chart data. A SQL statement like below could all the time provide only the last four values for the chart: Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SELECT temp_time, temp_valueFROM tempsORDER BY temp_time DESCLIMIT 4; --Or variable parameter value from GUI ---------------------------------------------------------------------- mica · 2015-12-08 00:38 Quote from: wp on December 07, 2015, 11:59:02 pmShouldn't be a problem. Just ask here if you have difficulties. What happens with data older than 24 hours? Are they dropped from the chart? At which time interval will you get the temperatures? yep data is not important its only plotting the graph. i think of something like a round robin with a self scrolling  6h "window" displayed. Interval is 5 min at the moment. ---------------------------------------------------------------------- wp · 2015-12-08 11:59 In the attachment you find a possible solution (out of many others) how you could achieve what you want. The form contains a timer which creates pseudo-temperature values at 1 second intervals - I reduced the interval from your 5 minutes in order to see an effect while running the program. The program collects all data during 20 seconds, when this not enough any more older values are dropped. It uses a ChartNavScrollbar to display only the most recent 10 seconds and to be able to scroll back to older values. Please note that the visible window is always moved back to the most recent data value whenever new data arrive - in the demo's 1 second data arrival rate it may be too difficult to navigate through the entire 20 second data interval by using the scrollbar, but it is very easy with your 5 minutes interval. ---------------------------------------------------------------------- mica · 2015-12-09 17:56 sorry for the late reply Thanks for the example it fits my needs, points me in the right direction and saved me a lot of research time one little question: there was a DateTimeIntervalChartSource1.NiceLabelStart property unknown to Lazarus 1.4.4 when was it introduced? ---------------------------------------------------------------------- wp · 2015-12-09 18:01 Quote from: mica on December 09, 2015, 06:56:09 pmthere was a DateTimeIntervalChartSource1.NiceLabelStart property unknown to Lazarus 1.4.4 when was it introduced? Sorry, it was never added officially so far. I wrote the demo program on my development installation of Lazarus where I had experimented with the DataTimeChartSource some time ago.