-
canvas size
I'm implementing a custom bar chart by extending QwtPlot and overriding the drawItems() method. I set the number of bars i have to draw on the canvas in a particular method(in which i create the plotItems). I dont want the bar width to be too small or too big. How do i restrict the canvas size for this? (i compute the bar width in draw items as canvas()->width() / Number_of_items).
-
Re: canvas size
Do it the other way round: calculatate the width of the bars from the canvas size.
Uwe
-
Re: canvas size
That is what i do now. But if the the number of bars is very small and the canvas size is very big, the bars do not look so nice. that is why i want to limit the canvas size from (Number_of_Bars * Min_Bar_Width) to (Number_of_Bars * Max_Bar_Width)
-
Re: canvas size
You can limit the size of the complete plot widget like for any other Qt widget.
Uwe