PDA

View Full Version : Request Qwt histogram design advice



goes2bob
10th April 2008, 02:05
Program desire: display a histogram with values either on an axis, or inside the bar segment (or rectangle), or when the mouse hovers over the bar segment the value appears.

data: a date, time combination represents each histogram bar and an integer represents the height of the histogram bar. The data is not linear or repeatable (i.e. dates and times are not the same each day and there may be a different number of segments per day).

I looked into putting the data in the axis, but before I invest a lot of time here, I thought I would use the forum.

The only other thing I can come up with is the QwtPlotPicker(but this returns graph coordinates and I cannot see how I can map this to the data in the graph). This way would probably serve the program better because there could be more histogram bars than room for axis text.

I would think that the option is there somewhere, but I have come up empty-handed :(

Thanks in advance,
Goes2BoB

Uwe
10th April 2008, 11:12
Program desire: display a histogram with values either on an axis, or inside the bar segment (or rectangle), or when the mouse hovers over the bar segment the value appears.

In SVN trunk ( = 5.2 development branch ) you find a draft of a QwtPlotHistogram implementation. It's still incomplete, but might be enough for your needs. Here you can overload QwtPlotHistogram::drawColumn or implement tooltips easily using QwtPlotHistogram::columnRect.

At the moment my focus is on the 5.1 release and the 5.2 branch is a bit orphaned. So it might need some time until a 5.2 release, but you can copy the implementation to your code and backport it to 5.0.

Uwe