Histogram even number bin size

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Histogram even number bin size

Post by bdw » Wed Jan 29, 2014 9:08 pm

Hello,

I have a histogram where I want to always have even numbered bin sizes regardless of the data added to the graph.

For example 4 bins with a range of 0 - 10, 10-20, 20-30, and 30-40.

Is it possible to set these bin boundaries with the Histogram function or would it be easier for me to roll my own ?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Histogram even number bin size

Post by Yeray » Thu Jan 30, 2014 2:22 pm

Hello,

Do you mean a THistogramSeries or a THistogramFunction?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: Histogram even number bin size

Post by bdw » Thu Jan 30, 2014 8:46 pm

Hi Yeray,

Yes I'm currently using the THistogramFunction for this particular graph.

Basically the graphing works correctly if the data distribution has something in all the bins. If say there is no data in the 30-40 range and your bin range is 4 you get say 29 as your max you get 29 / 4 as your bin ranges rather than an even range.

I haven't tried but just typing the question made me think about it, I probably should just change the x-axis scale from auto and set it manually. Maybe its a case of me needing more sleep...

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: Histogram even number bin size

Post by bdw » Thu Jan 30, 2014 9:06 pm

In thinking some more, this will solve the x-axis numbering but won't effect the legend etc which uses the bin size and maximum number to calculate the percentages.

So I guess what I'm saying for the 30-40 band I'd want the legend to say 0%.

Maybe a fixed size x-axis will do this, I'll have to try.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Histogram even number bin size

Post by Yeray » Tue Feb 04, 2014 9:29 am

Hello,

Excuse us for the delayed reply here.
I'm not sure to understand what's the exact situation. If you still find problems with it, it would be helpful if you could arrange a simple example project we can run as-is to reproduce the situation here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply