TAChart: Live plotting lazarus / 55-TAChart ---------------------------------------------------------------------- r0th · 2011-10-21 18:28 Hello everybody! I want to do a live plotting application with TAChart component. I attached my first attempt to this post. (It was developed with Lazarus 0.9.31, fpc 2. 5.1, Win7 x64) I searched for while and read some documentation, but for live plotting there is nothing available, I guess. I use a (dynamically generated) array with e. g. sinus values for plotting. How do I implement a clipping? -> x-Axis shifts from right to left, when x > 100 (e.g.)? I tried to implement clipping, but it didn't work out that well. Open for any suggestions! Cheers, Sascha P. S.: This is just a very simple code. Later on I want to plot a signal delivered by a microcontroller via COM-Port, so "delay"-procedure isn't needed anymore. ---------------------------------------------------------------------- Ask · 2011-10-21 20:50 QuoteHow do I implement a clipping? -> x-Axis shifts from right to left, when x > 100 (e.g.)?I do not quite understand what you want, but if you want to only display last 100 values, you can use ListSource.Delete method to remove older points from the series source. Also note that using standard TTimer is preferable to the Delay function you implemented. ---------------------------------------------------------------------- mas steindorff · 2011-10-21 22:14 Quote from: Ask on October 21, 2011, 10:50:50 pmQuoteHow do I implement a clipping? -> x-Axis shifts from right to left, when x > 100 (e.g.)?..., but if you want to only display last 100 values, you can use ListSource.Delete method to remove older points from the series source. Did .Delete get changed so that the X-Axis is rescale?  when I tried that, I ended up watching the trace get smaller and smaller as the X-axis kept growing.  I ended up using a clear and then reloading each line. ---------------------------------------------------------------------- Ask · 2011-10-22 17:52 QuoteDid .Delete get changed so that the X-Axis is rescale?  when I tried that, I ended up watching the trace get smaller and smaller as the X-axis kept growing.  I ended up using a clear and then reloading each line. Delete from the list source should update all referring chart series at least since Lazarus 0.9.30. After a close look, I did in fact discover a bug in Delete (see r33023-33024), but it should not affect the basic scenario of adding points from the one side of the source while deleting from the other side. Since this topic was raised for several times already, I have added "Oscilloscope" page to the line demo as an example in r33022. Basic example is very simple, the only tricky part is related to zooming such a "live" chart. Note that using "Delete" moves all the points inside the source, so if the speed is of the concern (approximately when the series display more than a few thousands points at each moment), user-defined series with a circular buffer may be used for optimization.