Delphi - histogram

the source code of this page may not appear correctly in certain browsers
due to special characters. Have a look at the source of this HTML page
with notepad instead

A histogram is onedimensional statistical display. It displays a count
value against a parameter. The parameter here is integer. The counts are
also integer. This component relies on an external TImage, where it is
displayed. It uses a variable array for D3 compatibility.

Besides the defined number of slots, there are two addional ones,
one for lower and one for higher values than defined by min/max.
They can be included (includebound) and appear as red bars.

Use it as :
histimage:TImage; // is setup somewhere
myhist:=TIntHistogram.create(101,0,100,histimage); // 101 slots from 0..100, onto histimage
for i:=.. to .. do begin // loop over samples
myhist.addvalue(q); // q is the parameter of the histogram
end;
myhist.display;
myhist.movetomemo(memo1); // get the numbers as list
myhist.destroy;