Menu

#5 Initialize histogram max

open
nobody
None
5
2007-05-07
2007-05-07
Christian
No

The max value of the histgram is used to draw the bars: top of the bar is the max value, bottom zero. Bars of values in between are drawn in proportion to the max value, e.g. half value is drawn as a bar of half the hight of the histogram.
The max value is a dynamic value, i.e. every new value higher than the current max value is saved as the new max value.
Therefore, after program start, a lot of bars are usually drawn the full height of the histogram even if the value is quite small.
As the max value converges some "real" maximum during runtime, a bar for the same small value is drawn shorter and shorter - and even might disappear at all.

To overcome the problem, the max value can be initialized via config file with a value that is already quite near the "real" possible maximum.

E.g. network monitor: if you initialize the max value via config file roughly with the max bandwith (in KB) of your connection then all bars are drawn with the right proportion immediately after program start.

Discussion


Log in to post a comment.