[fpc-pascal] Fastest way of drawing 2D graphs

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri Sep 12 16:13:59 CEST 2014

On 12/09/14 13:51, Hunter1972 wrote:
> I will check what these libraries can do and how fast.

You can also take a look at AggPas. It is a very good 2D vector graphics
engine and loads of example apps that show scaling and panning. A copy
can be found in the fpGUI or Lazarus code repository. The one included
with fpGUI has a bit more bug fixes though.

> Ok, I will describe the task in details (test code with sample data
> ...snip...
> maximum can give 26*26*4000=~2,7 millions points. The detections can
> be of 1 minute length, 2,7 * 60(secs) = around 150 millions points. 

The way I would program that is to not use ALL data points on the
"zoomed out" / overview graph. Instead divide it into equal sample
points that still gives you reasonable accuracy. When you select a range
and zoom in, use that range of data points (from the origin 150 mil),
but again divide the range equally in sample points and pick sample
data. The further you zoom in, the more data points you will use - thus
keeping accuracy.

I hope I explained that so you understand.


fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-pascal mailing list