Mega Search
23.2 Million


Sign Up

Make a donation  
TeeChart Equal height binning  
News Group: embarcadero.public.delphi.reporting-charting

I'm new with TeeChart so I'm looking for help with the histogram. I managed to create a histogram with equal width binning but I also need to create a histogram with equal height binning and I don't know how. I'd like to do something like this: http://www.saedsayad.com/unsupervised_binning.htm

I just don't know how to change the width of the bins with either HistogramSeries or AreaSeries.

any help is appreciated.

Thank you

Alain

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 2-Jun-2014, at 5:27 PM EST
From: Alain Forget
 
Re: TeeChart Equal height binning  
News Group: embarcadero.public.delphi.reporting-charting
Hi Alain,

> {quote:title=Alain Forget wrote:}{quote}
> I'm new with TeeChart so I'm looking for help with the histogram. I managed to create a histogram with equal width binning but I also need to create a histogram with equal height binning and I don't know how. I'd like to do something like this: http://www.saedsayad.com/unsupervised_binning.htm
> 
> I just don't know how to change the width of the bins with either HistogramSeries or AreaSeries.

If I understand it correctly, these the "width" in the "equal width binning" means the number of bars to be drawn, and the "height" in the "equal height binning" means the value for all the bars.

Then, I'm still not sure to understand how to calculate the "k" from the link you've posted. However, this example (where I hardcode the "k" but I calculate the rest) seems to work fine for me here:

{code}uses Series, Math;

const
  Values : array[0..8] of double = (0, 4, 12, 16, 16, 18, 24, 26, 28);

procedure TForm1.FormCreate(Sender: TObject);

  procedure FindMinMax(Arr: array of Double; var AMin, AMax: Double);
  var
    i: Integer;
  begin
    AMin:=Arr[Low(Arr)];
    AMax:=Arr[Low(Arr)];
    for i:=1 to High(Arr) do
    begin
      if Arr[i]>AMax then AMax:=Arr[i];
      if Arr[i]=tmpMin+(k-1)*w)) or
           ((i>1) and (i=tmpMin+(i-1)*w) and (Values[j]
Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 5-Jun-2014, at 6:51 AM EST
From: Yeray Alonso